1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 16:59:03 +03:00
Commit Graph

527 Commits

Author SHA1 Message Date
Tom Gundersen
45af44d47d networkd: manager - enumerate addresses globally, rather than per-link
The kernel always returns all addresses, rather than only for the given link, so let's only enumerate once.
2014-12-08 22:13:40 +01:00
Tom Gundersen
0e707326fc sd-rtnl: fix bogus warning about dropping 20 bytes from multi-part messages
Nothing was being dropped, we just failed to account for the NLMSG_DONE.
2014-12-08 18:38:55 +01:00
Lennart Poettering
5f86c1f4c4 sd-bus: rework ELF error mapping table magic
The ELF magic cannot work for consumers of our shard library, since they
are in a different module. Hence make all the ELF magic private, and
instead introduce a public function to register additional static
mapping table.
2014-12-08 14:55:22 +01:00
Daniel Mack
840ceb897f sd-bus: follow kdbus changes (ABI break)
Implement a recent change in the kdbus pool logic:

PAYLOAD_VEC_OFF items are now referencing offsets relative to the
connection's pool, not to the item itself. Follow this change in
sd-bus.
2014-12-05 10:04:02 +01:00
Lennart Poettering
3e49a3a063 sd-bus: add extra assert check 2014-12-04 20:30:46 +01:00
Tom Gundersen
584d0d2aef sd-rtnl: rename sd_rtnl_message_route_get_{dst,src}_len to *_prefixlen
This makes the API more consistent.
2014-12-04 16:14:57 +01:00
Tom Gundersen
9e7e440835 networkd: add support for source routing 2014-12-04 16:02:05 +01:00
Lennart Poettering
00d75e5752 rtnl: order local addresses/gateways by the address itself as last resort
This way we can be sure that the returned list is stable regarding
modifications in the kernel.
2014-12-04 04:16:31 +01:00
Lennart Poettering
1d050e1e0a rtnl: when querying local addresses and gateways, take address family into account 2014-12-04 01:42:42 +01:00
Thomas Hindoe Paaboel Andersen
d2df88ffba sd-bus: avoid a null dereference 2014-12-04 00:24:44 +01:00
Lennart Poettering
a98433c05c rtnl: make checks for default routes more strict
Also check that the source netmask is 0, not only the destination
netmask.
2014-12-03 22:23:21 +01:00
Lennart Poettering
e9140aff75 nss-myhostname: always resolve the host name "gateway" to the local default gateway
This is useful inside of containers or local networks to intrdouce a
stable name of the default gateway host (in case of containers usually
the host, in case of LANs usually local router).
2014-12-03 21:48:45 +01:00
Lennart Poettering
1ed24c6170 busctl: fix 'command line' style output of properties 2014-12-02 13:23:04 +01:00
Tom Gundersen
722f7cc95c sd-rtnl: route - allow GETROUTE with AF_UNSPEC 2014-12-02 10:46:22 +01:00
Tom Gundersen
20dff6c4ff sd-rtnl: add sd_rtnl_message_{new_neigh,neigh_get_{family,ifindex}} 2014-12-02 10:19:53 +01:00
Tom Gundersen
e559b38493 sd-rtnl: add typesystem for RTM_*NEIGH 2014-12-02 10:19:52 +01:00
Tom Gundersen
64918838d5 sd-rtnl: add a bit more debugging in case a message is dropped 2014-12-02 00:59:34 +01:00
Tom Gundersen
73ae2b7dad sd-rtnl: message - allow checking for attributes without reading out their contents 2014-12-02 00:59:02 +01:00
Tom Gundersen
dae4de9d42 sd-rtnl: add sd_rtnl_message_route_get_family 2014-12-02 00:58:17 +01:00
Lennart Poettering
22d097a6bb sd-bus: move packet header definition to bus-protocol.h 2014-11-28 21:12:03 +01:00
Lennart Poettering
fed1e721fd treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1 2014-11-28 20:55:04 +01:00
Lennart Poettering
198b158f49 sd-bus: add support for matches against arrays of strings in messages 2014-11-28 20:29:44 +01:00
Lennart Poettering
d9fba53316 sd-bus: if a NULL signatures is passed to sd_bus_message_skip(), make it skip a single element of any type 2014-11-28 20:29:44 +01:00
Lennart Poettering
1abe54d9a9 sd-bus: add arrays of strings in the bloom filter
Let's do this right from the beginning, to prepare ground for udev
messages that most likely want to store list of strings (for device
tags) in messages, and filter on them.
2014-11-28 20:29:44 +01:00
Lennart Poettering
224b378767 sd-bus: make more connection properties readable 2014-11-28 20:29:43 +01:00
Lennart Poettering
5b820358cf sd-bus: add new sd_bus_get_address() for querying the current bus address
Also, update "busctl" to show this in its output.
2014-11-28 20:29:43 +01:00
Lennart Poettering
5c3026927d sd-bus: rename sd_bus_get_owner_id() → sd_bus_get_bus_id()
The ID returned really doesn't identify the owner, but the bus instance,
hence fix this misnaming.

Also, update "busctl status" to show the ID in its output.
2014-11-28 20:29:43 +01:00
Michal Schmidt
56f64d9576 treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.

Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'

Plus some whitespace, linewrap, and indent adjustments.
2014-11-28 19:49:27 +01:00
Michal Schmidt
8d3d7072e6 treewide: a few more log_*_errno + return simplifications
The one in tmpfiles.c:create_item() even looks like it fixes a bug.
2014-11-28 19:17:24 +01:00
Michal Schmidt
f647962d64 treewide: yet more log_*_errno + return simplifications
Using:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
 'local $/;
  local $_=<>;
  s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg;
  print;'
 $f
done

And a couple of manual whitespace fixups.
2014-11-28 18:56:16 +01:00
Michal Schmidt
23bbb0de4e treewide: more log_*_errno + return simplifications 2014-11-28 18:24:30 +01:00
Lennart Poettering
1797280193 sd-bus: make sure %m resolves to the specified error in bus_error_set_errnofv() 2014-11-28 16:30:53 +01:00
Lennart Poettering
e3afaf6b8e sd-bus: rename default bus address constants, they aren't "paths" but "addresses" 2014-11-28 16:17:33 +01:00
Lennart Poettering
3acc1dafd1 sd-bus: add new call sd_bus_get_scope() for querying whether one is connected to a system or a user bus 2014-11-28 16:17:33 +01:00
Lennart Poettering
52cfc0379a sd-bus: rework credential query logic
Also, make the call to free kdbus slices generic and use it everywhere
2014-11-28 16:17:33 +01:00
Michal Schmidt
279d3c9cea treewide: more log_*_errno() conversions 2014-11-28 14:45:55 +01:00
Michal Schmidt
ff49bc3212 treewide: drop unnecessary trailing \n in log_*() calls 2014-11-28 14:26:31 +01:00
Michal Schmidt
da927ba997 treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values.
2014-11-28 13:29:21 +01:00
Michal Schmidt
0a1beeb642 treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:

find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'

Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno().
2014-11-28 12:04:41 +01:00
Lennart Poettering
1214b53c8e kdbus: when running in a container, don't complain that we cannot write to /sys 2014-11-28 03:16:56 +01:00
Lennart Poettering
412c18f10c sd-bus: the attach_mask kernel module parameter is 64bit now, hence initialize it as such 2014-11-28 02:25:45 +01:00
Lennart Poettering
1a29929959 kdbus: set kernel attach mask before creating the first bus 2014-11-27 22:05:24 +01:00
Lennart Poettering
fb6d9b77a7 sd-bus: set creds info for "org.freedesktop.DBus.Local" generated messages, too 2014-11-27 22:05:23 +01:00
Lennart Poettering
38ce47e262 sd-bus: when we get the list of well-known names back from kdbus we shouldn't confuse the empty list with unknown information 2014-11-27 22:02:13 +01:00
Lennart Poettering
771b2724c0 sd-bus: deal with whitespace in matches 2014-11-27 22:02:12 +01:00
Lennart Poettering
7d31d92400 sd-bus: unify logic how we patch the message source of driver messages 2014-11-27 22:02:12 +01:00
Lennart Poettering
ac653862e0 sd-bus: fake valid well-known-names metadata for faked bus messages 2014-11-27 22:02:12 +01:00
Lennart Poettering
50c4521675 sd-bus: optimize how we generate the well-known-names lists in messages from kdbus 2014-11-27 22:02:12 +01:00
Lennart Poettering
7fa934b0d3 sd-bus: be stricter with mismatches between dbus1 and kdbus message headers 2014-11-27 22:02:12 +01:00
Lennart Poettering
64e96a194d bus-proxy: check passed parameter signature of all driver method calls 2014-11-27 21:58:07 +01:00