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
Zbigniew Jędrzejewski-Szmek
4807d2d068 sd-event: be more careful when enabling/disabling signals
When a child event is disabled (in order to be freed) and there is no
SIGCHLD signal event, sd_event_source_set_enabled will disable SIGCHLD
even if there are other child events.

Also remove some unneeded signalfd updates.

https://bugs.freedesktop.org/show_bug.cgi?id=84659

Based-on-a-patch-by: Hristo Venev <mustrumr97@gmail.com>
2014-10-08 19:30:22 -04:00
Daniel Mack
40885bb29e sd-bus: sync kdbus.h (ABI break)
Sync kdbus.h once again. Two thing have changed:

 a) KDBUS_CMD_EP_* was renamed to KDBUS_CMD_ENDPOINT_*
 b) struct kdbus_cmd_hello and struct kdbus_cmd_make gained a
    'features' bitfield (which is currently unused)
2014-10-08 17:30:49 +02:00
Daniel Mack
8bf13eb1e0 sd-bus: check return value of vasprintf
Check for OOM situations when vasprintf() returns < 0 in bus_error_setfv().

Spotted by coverity.
2014-10-07 12:10:06 +02:00
Daniel Mack
53e9dbcdfb sd-bus: fix KDBUS_CMD_FREE user
Fix a user of the KDBUS_CMD_FREE ioctl that was missed in the transition.
2014-10-07 12:02:04 +02:00
Daniel Mack
ca794c8e95 sd-bus: fix use-after-free in close_kdbus_msg()
Walk the items first, then free the memory of the message.

Also, while at it, make coverity happy with an explicit (void) prefix.
We intentionally ignore the return value here.
2014-10-07 11:38:31 +02:00
Thomas Hindoe Paaboel Andersen
13303f018d sd-bus: remove unused variable
It is no longer used after d663f1b1a9
2014-10-07 00:00:21 +02:00
Daniel Mack
d663f1b1a9 sd-bus: sync kdbus.h (ABI break)
The KDBUS_CMD_FREE ioctl now uses a struct rather than a direct pointer
to the offset to free.

The KDBUS_CMD_MSG_CANCEL ioctl has also changes, but there's no user of
it yet in systemd.
2014-10-06 18:36:16 +02:00
Zbigniew Jędrzejewski-Szmek
75a0da952f bus: add assert to check that we're not freeing a static structure
CID #996315.
2014-10-05 15:29:41 -04:00
Zbigniew Jędrzejewski-Szmek
cef3566998 sd-id128: do stricter checking of random boot id
If we are bothering to check whether the kernel is not feeding us
bad data, we might as well do it properly.

CID #1237692.
2014-10-03 20:57:30 -04:00
Zbigniew Jędrzejewski-Szmek
125dd07483 sd-bus: split out cleanup into separate function
m is always non-null at this point. This function is too long anyway.
2014-10-03 20:42:09 -04:00
Zbigniew Jędrzejewski-Szmek
7057bd9931 sd-event: check the value of received signal
Appease coverity report #1237775.

Also rename ss to n, to make it visually different from ss.
2014-10-03 20:42:09 -04:00
Lennart Poettering
2c652b6bfe kdbus: don't clobber return values, use strjoin() instead of asprintf(), keep function invocations and variable declarations separate 2014-10-02 20:38:00 +02:00
Lennart Poettering
8e00bfc234 kdbus: make sure we never invoke free() on an uninitialized pointer on OOM 2014-10-02 20:38:00 +02:00
Daniel Mack
995a1063db sd-bus: sync kdbus.h (ABI break!)
struct kdbus_cmd_match got a flags field, which systemd currently makes no
use of.
2014-10-02 17:15:39 +02:00
Daniel Mack
581fe6c817 sd-bus: sync kdbus.h (ABI break)
struct kdbus_cmd_conn_info takes a list of items now instead of a string.

Fix the only user in SD of that ioctl.
2014-10-02 13:04:04 +02:00
Simon McVittie
d20a3daaa7 sd-bus: use terms from the D-Bus Specification a bit more
D-Bus' type hierarchy as described in the spec is:

\- basic
   \- fixed type (u, i, etc.)
   \- string-like type (s, o, g)
\- container

Someone seems to have referred to basic types as "simple types" at
some point, but that term isn't defined in the D-Bus Specification,
and seems redundant.

So far I haven't renamed functions that use "trivial" in their names
to mean "fixed type", to avoid confusion about whether a struct of
constant length, like (iu), is a fixed type. The answer is that it is
fixed-length, but is not a "fixed type", so I can see that something
like bus_type_is_fixed() might be ambiguous.
2014-10-02 08:25:21 +02:00
Simon McVittie
e1ffdb90d9 PORTING-DBUS1: we use :1.%llu not :0.%llu for D-Bus unique bus names 2014-10-02 08:25:21 +02:00
David Herrmann
1679ddc460 bus: use 2M as maximum message size in benchmark
The kdbus limit is 2M and we removed the bus-owner override. Therefore,
use at most 2M as message size.
2014-09-29 15:44:44 +02:00
David Herrmann
8bf4a42a2e bus: sync kdbus.h (ABI break!) 2014-09-29 15:37:31 +02:00
Daniel Mack
f0c5e28e58 sd-bus: clean up string length calculation
Move the +1 calculus onto the definition of the variable, just to make
the code a little easier to read. No functional change.
2014-09-28 21:22:51 +02:00
Thomas Hindoe Paaboel Andersen
04c553e322 bus: remove unused check
strerror_r does not return null here and even if it did we would have
problems already at the preceding strlen call.

Found by coverity. Fixes: CID#1237770
2014-09-23 21:39:36 +02:00
Daniel Mack
590889ac53 sd-bus: sync kdbus.h 2014-09-23 17:37:44 +02:00
Daniel Mack
619d7a039f sd-bus: sync kdbus.h (API break)
Just a rename of two struct members to make the header file c++ compatible.
2014-09-23 16:16:04 +02:00
Daniel Mack
f8c2425287 sd-bus: sync kdbus.h (API+ABI break)
The kdbus logic name registry logic was changed to transport the actual
name to acquire, release or report in a kdbus item.

This brings the name API a little more in line with other calls, and allows
for later augmentation.

Follow that change on the systemd side.
2014-09-22 18:22:53 +02:00
David Herrmann
c72d5456e2 login: add public sd_session_get_desktop() API
The desktop brand is stored as DESKTOP variable for sessions. It can be
set arbitrarily by the session owner and identifies the desktop
environment that is running on that session.
2014-09-22 14:27:02 +02:00
David Herrmann
7f3d3ba1a6 bus: align kdbus ioctl parameters to 8byte
All kdbus ioctl arguments must be 8byte aligned. Make sure we use
alloca_align() and _alignas_(8) in all situations where gcc doesn't
guarantee 8-byte alignment.

Note that objects on the stack are always 8byte aligned as we put
_alignas_(8) into the structure definition in kdbus.h.
2014-09-22 14:27:02 +02:00
Emil Renner Berthing
1ed96046cb sd-rtnl: rtnl-message: remove unneeded linux includes 2014-09-18 17:37:55 +02:00
David Herrmann
c2fa048c4a bus: fix bus_print_property() to use "int" for booleans
We always use "int" if we retrieve boolean values from sd-bus, as "bool"
is only a single byte, but full int on va-args.

Thanks to Werner Fink for the report!
2014-09-18 13:57:13 +02:00
Daniel Mack
913b6d70cb sd-bus: sync kdbus.h
(no API/ABI break this time)
2014-09-18 10:25:38 +02:00
Cristian Rodríguez
4edf33d1e3 Fix resource leak (coverity CID 1237760) 2014-09-18 10:13:09 +02:00
David Herrmann
ff02f101cb bus: fix error leak in bus_node_exists()
If we call into user callbacks, we must always propagate possible errors.
Fix bus_node_exists() to do that and adjust the callers (which already
partially propagated the error).

Also speed up that function by first checking for registered enumerators
and/or object-managers.
2014-09-17 11:01:56 +02:00
David Herrmann
943c3f94e2 bus: never respond to GetManagedObjects() on sub-paths
The dbus-spec clearly specifies that GetManagedObjects() should only work
on the root-path of an object-tree. But on that path, it works regardless
whether there are any objects available or not.

We could, technically, define all sub-paths as a root-path of its own
sub-tree. However, if we do that, we enter undefined territory:

    Imagine only a fallback vtable is registered. We want
    GetManagedObjects() to *NOT* fail with UNKNOWN_METHOD if it is called
    on a valid sub-tree of the fallback. On the other hand, we don't want
    it to work on arbitrary sub-tree. Something like:
        /path/to/fallback/foobar/foobar/foobar/invalid/foobar
    should not work.
    However, there is no way to know which paths on a fallback are valid
    without looking at there registered objects. If no objects are
    registered, we have no way to figure it out.

Therefore, we now try to follow the dbus spec by only returning valid data
on registered root-paths. We treat each path as root which was registered
an object-manager on via add_object_manager(). So applications can now
directly control which paths to place an object-manager on.

We also fix the introspection to not return object-manager interfaces on
non-root paths.

Also fixes some dead-code paths initially reported by Philippe De Swert.
2014-09-17 11:01:52 +02:00
Thomas Hindoe Paaboel Andersen
b49ffb29ed sd-bus: sd_bus_message_get_errno should only return positive errno
sd_bus_message_get_errno can currently return either a number of
different poitive errno values (from bus-error-mapping), or a negative
EINVAL if passed null as parameter.

The check for null parameter was introduced in 40ca29a137
at the same as the function was renamed from bus_message_to_errno and
made public API. Before becoming public the function used to return
only negative values.

It is weird to have a function return both positive and negative errno
and it generally looks like a mistake. The function is guarded by the
--enable-kdbus flags so I wonder if we still have time to fix it up?
It does not have any documentation yet. However, except for a few details
it is just a convenient way to call sd_bus_error_get_errno which is documented
to return only positive errno.

This patch makes it return only positive errno and fixes up the two
calls to the function that tried to cope with both positive and negative
values.
2014-09-16 21:31:15 +02:00
Michal Schmidt
4dd6c5726d sd-bus: use proper ITERATOR_FIRST abstraction
Do not assume hashmap iterators are pointers.
They may be structs in an alternative hashmap implementation.
2014-09-15 16:08:50 +02:00
Michal Schmidt
d5099efc47 hashmap: introduce hash_ops to make struct Hashmap smaller
It is redundant to store 'hash' and 'compare' function pointers in
struct Hashmap separately. The functions always comprise a pair.
Store a single pointer to struct hash_ops instead.

systemd keeps hundreds of hashmaps, so this saves a little bit of
memory.
2014-09-15 16:08:50 +02:00
Philippe De Swert
2b347169b9 bus: unref buscreds on failure
Actually unref the buscreds when we are not going to return a
pointer to them. As when bus_creds_add_more fails we immediately
return the error code otherwise and leak the new buscreds.
Found with coverity. Fixes: CID#1237761
2014-09-11 17:29:19 +02:00
Philippe De Swert
fd989a0bc9 bus: avoid using m->kdbus after freeing it
m->kdbus could be freed before it is released. Changing the
order fixes the issue.

Found with Coverity. Fixes: CID#1237798
2014-09-11 17:09:50 +02:00
Tom Gundersen
aedca89268 udev: net_setup_link - open ethtool and rtnl connections lazily 2014-09-09 15:36:56 +02:00
Tom Gundersen
4c83d99456 udev: event - keep one rtnl per worker, rather than per event
Creating the rtnl context is cheap, but freeing it may not be, due to
synchronous close().

Also drop some excessive logging. We now log about the changing ifname
exactly once.
2014-09-09 15:30:10 +02:00
Tom Gundersen
adc5b2e2eb sd-network: add _get_network_file api 2014-09-08 15:09:07 +02:00
Daniel Mack
e7d718afdb bus: add code to create custom endpoints and set their policy
Custom endpoints are alternative connection points to a bus, allowing
specific policy to be uploaded.

Add two functions to bus-kernel. One to create such endpoints, and another
one for setting a policy for them.
2014-09-08 11:06:45 +02:00
Daniel Mack
5369c77d2e bus: factor out bus policy items
In order to re-use the policy definitions, factor them out into their own
files.
2014-09-08 11:06:45 +02:00
Tom Gundersen
cedc611207 sd-rtnl: don't assign to unused variable
Reported by Thomas H.P. Andersen <phomes@gmail.com>.
2014-09-01 22:59:52 +02:00
Ruben Kerkhof
06b643e7f5 Fix a few more typos 2014-08-30 13:46:07 -04:00
Ruben Kerkhof
6ff8806e1d Fix a few typos in log messages 2014-08-29 09:28:19 -04:00
David Herrmann
32b13b2f58 sd-event: simplify sd_event_source_set_name()
free_and_strdup() does exactly the same as sd_event_source_set_name(), use
it!
2014-08-28 22:44:28 +02:00
Tom Gundersen
9021bb9f93 sd-event: name event sources used in libraries
This should help in debugging failing event sources.
2014-08-28 21:19:17 +02:00
Tom Gundersen
752bbf75b9 sd-event: use event source name rather than address in debug messages 2014-08-28 21:19:17 +02:00
Tom Gundersen
f7f53e9e6e sd-event: allow naming event sources 2014-08-28 21:19:17 +02:00
Tom Gundersen
5968b1c304 sd-rtnl: log if kernel buffer is overrun as we currently can't handle that case 2014-08-28 21:19:16 +02:00
David Herrmann
427c71629e bus: don't skip interfaces in bus_message_map_properties_changed()
Skipping interfaces randomly without the caller specifying it is nasty.
Avoid this and let the caller do that themselves.
2014-08-28 15:25:51 +02:00
David Herrmann
d974ad0524 bus: fix use-after-free in slot-release
We must not access slot->floating after we possible dropped the last
reference to it. Fix all callback-invocations to first check
slot->floating and possible disconnect the slot, then release the last
reference.
2014-08-28 12:45:51 +02:00
David Herrmann
aae2b488d0 bus: split bus_map_all_properties into multiple helpers
The bus_map_all_properties() helper calls
org.freedesktop.DBus.Properties.GetAll() on a given target and parses the
result according to a given property-table. This simplifies dealing with
DBus.Properties significantly. However, the function is blocking and thus
not really useful in many situations.

This patch extracts the core of this function and adds two new helpers
which directly take dbus-messages as arguments. This way, you can issue
asynchronous requests and parse the result via these helpers:

  bus_message_map_all_properties():
      This is the same as bus_map_all_properties() but takes the result
      message from a GetAll() request as argument. You can thus issue an
      asynchronous GetAll() request and then use this helper once you got
      the result.

  bus_message_map_properties_changed():
      This function takes a signal-message that was retrieved via a
      PropertiesChanged signal and then parses it like if you retrieved
      it via GetAll(). Furthermore, this function returns the number of
      matched properties that got invalidated by the PropertiesChanged
      signal, but didn't carry the new value. This way, the caller can
      issue a new GetAll() request and then parse the result.

The old function bus_map_all_properties() is functionally unchanged, but
now uses bus_message_map_all_properties() internally.
2014-08-27 18:42:28 +02:00
Hristo Venev
f2322f0b64 sd-bus: don't include internal header memfd.h in public header sd-bus.h
https://bugs.freedesktop.org/show_bug.cgi?id=83097
2014-08-26 20:40:35 +02:00
Lennart Poettering
bb19cb1707 sd-bus: remove unused call bus_kernel_create_monitor()
Noticed by Djalal Harouni
2014-08-26 20:35:44 +02:00
Tom Gundersen
6d148a842e sd-event: sd_event_prepare - stay in PREPARED if sd_event_wait() indicates that no sources are pending 2014-08-26 00:22:06 +02:00
Tom Gundersen
c45a5a7446 sd-event: split run into prepare/wait/dispatch
This will allow sd-event to be integrated into an external event loop, which
in turn will allow (say) glib-based applications to use our various libraries,
without manually integrating each of them (bus, rtnl, dhcp, ...).

The external event-loop should integrate sd-event int he following way:

Every iteration must start with a call to sd_event_prepare(), which will
return 0 if no event sources are ready to be processed, a positive value if
they are and a negative value on error. sd_event_prepare() may only be called
following sd_event_dispatch(); a call to sd_event_wait() indicating that no
sources are ready to be dispatched; or a failed call to sd_event_dispatch() or
sd_event_wait().

A successful call to sd_event_prepare() indicating that no event sources are
ready to be dispatched must be followed by a call to sd_event_wait(),
which will return 0 if it timed out without event sources being ready to
be processed, a negative value on error and a positive value otherwise.
sd_event_wait() may only be called following a successful call to
sd_event_prepare() indicating that no event sources are ready to be dispatched.

If sd_event_wait() indicates that some events sources are ready to be
dispatched, it must be followed by a call to sd_event_dispatch(). This
is the only time sd_event_dispatch() may be called.
2014-08-25 21:52:36 +02:00
Lennart Poettering
430e21c2f7 bus: when terminating our bus-actviated services that exit-on-idle send STOPPING=1 via sd_notify()
This should fix a race where a service thatis idle drops its name, and
is immediately requested by another client, which causes dbus-daemon to
ask systemd to activate it again, but since systemd still assumes it is
running it won't do anything.
2014-08-21 17:24:22 +02:00
Tom Gundersen
9b36454543 sd-event: add API to access epoll_fd
This is a prerequisite for integrating sd-event into an external
event loop.
2014-08-20 17:24:11 +02:00
Thomas Hindoe Paaboel Andersen
ac45dec934 remove unused variables 2014-08-19 22:55:42 +02:00
Lennart Poettering
4531a9bc20 memfd: simplify API
Now, that the memfd stuff is not exported anymore, we can simplify a few
things:

Use assert() instead of assert_return(), since this is used internally
only, and we should be less permissive then.

No need to pass an allocated fd back by call-by-reference, we can just
directly return it.
2014-08-19 19:39:16 +02:00
David Herrmann
1ac36c67dd bus: map sealed memfds as MAP_PRIVATE
Mapping files as MAP_SHARED is handled by the kernel as 'writable'
mapping. Always! Even with PROT_READ. Reason for that is,
mprotect(PROT_WRITE) could change the mapping underneath and currently
there is no kernel infrastructure to add protection there. This might
change in the future, but until then, map sealed files as MAP_PRIVATE so
we don't get EPERM.
2014-08-18 23:56:36 +02:00
Denis Kenzior
fe3f22d116 bus-control: Fix cgroup handling
On systems without properly setup systemd, cg_get_root_path returns
-ENOENT.  This means that busctl doesn't display much information.

busctl monitor also fails whenever it intercepts messages.

This fix fakes creates a fake "/" root cgroup which lets busctl work
on such systems.
2014-08-18 21:01:57 +02:00
Lennart Poettering
630a4d9ea7 Merge remote-tracking branch 'origin/master' 2014-08-18 18:12:55 +02:00
Lennart Poettering
f38857914a bus-util: simplify bus_verify_polkit_async() a bit
First, let's drop the "bus" argument, we can determine it from the
message anyway.

Secondly, determine the right callback/userdata pair automatically from
what is currently is being dispatched. This should simplify things a lot
for us, since it makes it unnecessary to pass pointers through the
original handlers through all functions when we process messages, which
might require authentication.
2014-08-18 17:49:53 +02:00
Lennart Poettering
caa829849d sd-bus: add API to query which handler/callback is currently being dispatched 2014-08-18 17:49:53 +02:00
Daniel Mack
fac9c0d508 memfd: internalize functions, drop sd_memfd type
Remove the sd_ prefix from internal functions and get rid of the sd_memfd
type. As a memfd is now just a native file descriptor, we can get rid of our
own wrapper type, and also use close() and dup() on them directly.
2014-08-18 13:32:08 +02:00
Daniel Mack
4632777024 memfd: fix memfd_create() syscall wrapper
Unlike earlier versions, the syscall only takes 2 arguments in its
final version, not 3.
2014-08-18 12:37:22 +02:00
Daniel Mack
43bde981cc memfd: move code from public library to src/shared
Don't expose generic kernel API via libsystemd, but keep the code internal
for our own usage.
2014-08-18 12:37:20 +02:00
Daniel Mack
a6082d778e kdbus: switch over to generic memfd implementation (ABI+API break) 2014-08-17 21:47:00 +02:00
Thomas Hindoe Paaboel Andersen
f1e3bee216 sd-bus,log: remove unused variables 2014-08-16 00:32:21 +02:00
Tom Gundersen
050f74f286 sd-event: return 'r' rather than '-errno' 2014-08-15 20:32:27 +02:00
Lennart Poettering
b5af2aca12 Merge commit 'b39a2770ba55637da80e2e389222c59dbea73507' 2014-08-15 20:25:10 +02:00
Tom Gundersen
e07bbb7c50 sd-event: fix missing needs_rearm 2014-08-15 20:20:38 +02:00
Lennart Poettering
def9a7aa01 sd-bus: add API to check if a client has privileges
This is a generalization of the vtable privilege check we already have,
but exported, and hence useful when preparing for a polkit change.

This will deal with the complexity that on dbus1 one cannot trust the
capability field we retrieve via the bus, since it is read via
/proc/$$/stat (and thus might be out-of-date) rather than directly from
the message (like on kdbus) or bus connection (as for uid creds on
dbus1).

Also, port over all code to this new API.
2014-08-15 20:08:51 +02:00
Lennart Poettering
8612e93653 sd-network: add system-wide sd_network_get_domains() API 2014-08-15 16:02:14 +02:00
Lennart Poettering
31d2e1961a sd-nework: be more careful with error codes, return ENODATA if you lack information 2014-08-15 15:34:33 +02:00
Tom Gundersen
67272d157a sd-network: add support for wildcard domains 2014-08-15 15:15:24 +02:00
Stef Walter
36e34057a2 sd-bus: Remove bus arg from bus_verify_polkit_async_registry_free()
It's unneccessary, not used, and complicates callers of the
function.
2014-08-15 14:07:07 +02:00
Lennart Poettering
db73295acc util: never use ether_ntoa(), since it formats with %x, not %02x, which makes ethernet addresses look funny 2014-08-15 13:19:03 +02:00
Tom Gundersen
9b4d1882ca sd-network: add sd_network_linkg_get_domains()
For now this only exposes the domain name (DHCP Option 15), and not
the search string (DHCP Option 119), which will be implemented in
a follow-up patch.
2014-08-14 23:13:14 +02:00
Tom Gundersen
d06441da04 sd-event: drop _likely_()
This is not certain to be likely.

Lennart says: a frequent usecase is invoking some function regularly in intervals
in such a case every single iteration we'll have to rearm
2014-08-14 02:00:43 +02:00
Tom Gundersen
212bbb1798 sd-event: do not arm timers unnecessarily
Rather than recalculating the next timeout on every loop, we only do it when something changed.
2014-08-14 01:29:51 +02:00
Tom Gundersen
438ca2bbd4 sd-networkd: rename link_get_state to link_get_setup_state
Suggested by Kay and Lennart.
2014-08-13 22:55:49 +02:00
Tom Gundersen
d6731e4c79 sd-network: /_get_link_/_link_get_/
The link is the 'object', so make this in line with our usual naming convention.

Suggested by Kay and Lennart.
2014-08-13 22:37:45 +02:00
Denis Kenzior
587f21d8c0 bus-bloom: Fix bloom filter calculation
i is being used incorrectly.  It is used to refer to the number of
indexes calculated so far (out of k).  However, it is also incremented
when a new hash key is being used.  This means that the results are
inconsistent with the desired behavior described in PORTING-DBUS1
document.

The expected result is that for the default values of m and k (512, 8)
the 1st hash key should produce 4 indexes.  The second hash key is used
for the next 4 and overall 8 indexes into m are calculated.

The current behavior results in 6 indexes being calculated, 4 coming
from hash key 1 and 2 others from hash key 5.
2014-08-13 16:24:59 +02:00
Tom Gundersen
8434fd5cf2 sd-network: rename state INITALIZING to PENDING and expose as any other state
This is the state when we are waiting for udev to initialize the device, and waiting for
libudev and rtnl to be in sync. In the future we probably will also be waiting for nl80211.
At this point we do not yet have enough information to know whether or not networkd should
be handling the device.
2014-08-13 15:39:57 +02:00
Lennart Poettering
96c76ac49c sd-resolve: scale number of threads by queries currently being processed, rather than number of queries currently referenced
This way a query that blocks for a longer time, and whose reference has
been dropped won't block subsequent lookups from finishing.
2014-08-12 19:30:18 +02:00
Lennart Poettering
85529c815b sd-resolve: fix allocation if query ids, never reuse them 2014-08-12 19:29:27 +02:00
Lennart Poettering
502fe44ea4 sd-resolve: keep floating query referenced while we access it 2014-08-12 19:28:32 +02:00
Lennart Poettering
84e51726a3 timesyncd: split up into multiple source file
The source file got much too large, hence split up the sources into
multiple per-object files, similar in style to resolved.
2014-08-12 16:58:56 +02:00
Lennart Poettering
03cc0fd143 sd-network: add API to output all collected system-wide NTP and DNS servers
Also, output the collected information in "networkctl".
2014-08-12 15:06:51 +02:00
Lennart Poettering
a903fd34c0 sd-network: move sd-network API into libsystemd proper
In contrast to the DHCP/IPv4LL/ICMP6 APIs sd-network is not a protocol
implementation but a client API for networkd, hence move it into
libsystemd proper.
2014-08-12 02:12:05 +02:00
Lennart Poettering
ee8c456895 networkd: add minimal client tool "networkd" to query network status
In the long run this should become a full fledged client to networkd
(but not before networkd learns bus support). For now, just pull
interesting data out of networkd, udev, and rtnl and present it to the
user, in a simple but useful output.
2014-08-12 01:54:40 +02:00
Daniel Mack
15aa9b201c sd-bus: sync kdbus.h (ABI break) 2014-08-10 21:46:45 +02:00
Lennart Poettering
249968612f bus: always explicitly close bus from main programs
Since b5eca3a205 we don't attempt to GC
busses anymore when unsent messages remain that keep their reference,
when they otherwise are not referenced anymore. This means that if we
explicitly want connections to go away, we need to close them.

With this change we will no do so explicitly wherver we connect to the
bus from a main program (and thus know when the bus connection should go
away), or when we create a private bus connection, that really should go
away after our use.

This fixes connection leaks in the NSS and PAM modules.
2014-08-04 16:25:24 +02:00
Zbigniew Jędrzejewski-Szmek
601185b43d Unify parse_argv style
getopt is usually good at printing out a nice error message when
commandline options are invalid. It distinguishes between an unknown
option and a known option with a missing arg. It is better to let it
do its job and not use opterr=0 unless we actually want to suppress
messages. So remove opterr=0 in the few places where it wasn't really
useful.

When an error in options is encountered, we should not print a lengthy
help() and overwhelm the user, when we know precisely what is wrong
with the commandline. In addition, since help() prints to stdout, it
should not be used except when requested with -h or --help.

Also, simplify things here and there.
2014-08-03 21:46:07 -04:00
Kay Sievers
e90b8642cd kdbus: update header 2014-07-31 23:08:44 +02:00
Zbigniew Jędrzejewski-Szmek
73f860db98 Always prefer our headers to system headers
In practice this shouldn't make much difference, but
sometimes our headers might be newer, and we want to
test them.
2014-07-31 08:56:03 -04:00
Zbigniew Jędrzejewski-Szmek
a2a5291b3f Reject invalid quoted strings
String which ended in an unfinished quote were accepted, potentially
with bad memory accesses.

Reject anything which ends in a unfished quote, or contains
non-whitespace characters right after the closing quote.

_FOREACH_WORD now returns the invalid character in *state. But this return
value is not checked anywhere yet.

Also, make 'word' and 'state' variables const pointers, and rename 'w'
to 'word' in various places. Things are easier to read if the same name
is used consistently.

mbiebl_> am I correct that something like this doesn't work
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"'
mbiebl_> systemd seems to strip of the quotes
mbiebl_> systemctl status shows
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS  $RootDir $MountPoint
mbiebl_> which is pretty weird
2014-07-31 04:00:31 -04:00
Kay Sievers
3a43da2832 time-util: add and use USEC/NSEC_INFINIY 2014-07-29 13:20:20 +02:00
Zbigniew Jędrzejewski-Szmek
8f077bf94e Print kdbus path when opening fails
This makes it easier to debug what is going on.
2014-07-26 15:08:42 -04:00
Tom Gundersen
a854881616 sd-event: add support for CLOCK_BOOTTIME
This requires a very recent kernel (3.15), so care should be taken
when using this functionality.
2014-07-24 16:37:01 +02:00
Dan Williams
28cc555d85 networkd: set route protocol
All routes added by networkd are currently set RTPROT_BOOT, which according
to the kernel means "Route installed during boot" (rtnetlink.h).  But this
is not always the case as networkd changes routing after boot too.  Since
the kernel gives more detailed protocols, use them.

With this patch, user-configured static routes now use RTPROT_STATIC (which
they are) and DHCP routes use RTPROT_DHCP.  There is no define for IPv4LL
yet, so those are installed as RTPROT_STATIC (though perhaps RTPROT_RA is
better?).

[tomegun: fixup
src/network/networkd-link.c:972:33: error: too few arguments to function 'route_new_dynamic']
2014-07-23 09:19:32 +02:00
Susant Sahani
801a04c81b sd-rtnl: uncomment bond rtnl constants 2014-07-21 20:35:21 +02:00
Lennart Poettering
0dd25fb9f0 change type for address family to "int"
Let's settle on a single type for all address family values, even if
UNIX is very inconsitent on the precise type otherwise. Given that
socket() is the primary entrypoint for the sockets API, and that uses
"int", and "int" is relatively simple and generic, we settle on "int"
for this.
2014-07-18 16:10:51 +02:00
Lennart Poettering
ca4e095ab9 sd-rtnl: make string returned by sd_rtnl_message_read_string() const 2014-07-18 12:38:32 +02:00
Lennart Poettering
634af5665f sd-login: always use "indices" as plural of "index"
So far both "indexes" and "indices" was used. Let's clean this up, and
stick to indices, since it appears to be used more frequently.
2014-07-17 01:48:40 +02:00
Zbigniew Jędrzejewski-Szmek
86bbe5bfbc test-tables: add new entries
One missing string found.

A few things had to be moved around to make it possible to test them.
2014-07-16 19:00:03 -04:00
Lennart Poettering
92daebc0d0 sd-event: don't require a signal event source to be enabled for the child event source to work 2014-07-11 16:50:10 +02:00
David Herrmann
b63c8d4f03 sd-event: always call epoll_ctl() on mask-updates if edge-triggered
A call to sd_event_source_set_io_events() skipps calling into the kernel
if the new event-mask matches the old one. This is safe for
level-triggered sources as the kernel moves them onto the ready-list
automatically if events change. However, edge-triggered sources might not
be on the ready-list even though events are present.

A call to sd_event_source_set_io_events() with EPOLLET set might thus be
used to just move the io-source onto the ready-list so the next poll
will return it again. This is very useful to avoid starvation in
priority-based event queues.

Imagine a read() loop on an edge-triggered fd. If we cannot read data fast
enough to drain the receive queue, we might decide to skip reading for now
and schedule it for later. On edge-triggered io-sources we have to make
sure it's put on the ready-list so the next dispatch-round will return it
again if it's still the highest priority task. We could make sd-event
handle edge-triggered sources directly and allow marking them ready again.
However, it's much simpler to let the kernel do that for now via
EPOLL_CTL_MOD.
2014-07-11 16:43:53 +02:00
Lennart Poettering
6017365a1d endian: explicitly include endian.h wherever we want to use __BYTE_ORDER 2014-07-11 16:13:13 +02:00
Lennart Poettering
cabb0bc6b1 nss-mymachines: add new NSS module for automatically resolving addresses of all local containers 2014-07-11 03:15:21 +02:00
Lennart Poettering
2de30868ed build-sys: export sd_path APIs 2014-07-11 03:13:24 +02:00
Lennart Poettering
3cb4674019 libsystemd: make use of our common sockaddr_union everywhere 2014-07-10 21:16:40 +02:00
Lennart Poettering
3b653205cf shared: split out in_addr related calls from socket-util.[ch] into its private in-addr-util.[ch]
These are enough calls for a new file, and they are sufficiently
different from the sockaddr-related calls, hence let's split this out.
2014-07-10 21:15:26 +02:00
Lennart Poettering
e80af1bddd nss-myhostname: move local address listing logic into shared, so that we can make use of it from machined 2014-07-10 21:01:25 +02:00
Lennart Poettering
1389925348 event: pull in sd-event.h from event-util.h 2014-07-10 20:12:34 +02:00
Umut Tezduyar Lindskog
0c74488672 sd-path: add missing header 2014-07-03 16:41:52 -04:00
Lennart Poettering
613e3a26c1 shared: rename ARCH_TUPLE to LIB_ARCH_TUPLE
This is really just about library locations, hence clarify that we don't
assume this to be anything but that.
2014-07-03 15:40:14 +02:00
Lennart Poettering
620a687cd2 sd-login: use the same code for verfiying machine names everywhere 2014-07-03 01:19:26 +02:00
Lennart Poettering
db9bb83fa5 bus: close a bus that failed to connect 2014-07-03 01:19:21 +02:00
Lennart Poettering
7f0d207d2c sd-bus: support connecting to remote hosts, directly into containers
systemctl -H root@foobar:waldi

will now show a list of services running on container "waldi" on host
"foobar", using "root" for authenticating at "foobar".

Since entereing a container requires priviliges, this will only work
correctly for root logins.
2014-07-03 01:17:26 +02:00
Lennart Poettering
7bb4d371af sd-bus: when an event loop terminates, explicitly close the bus
This makes sure we actually release the bus and all the messages it
references.
2014-07-02 17:36:47 +02:00
Lennart Poettering
b5eca3a205 bus: drop bus/message GC logic
When a caller drops all references to a bus and its messages while the
messages where still queue, this causes the bus to reference the
messages, and the messages to reference the bus, without anybody else
keeping a reference, which is something we so far considered a leak, and
tried to fix with a GC logic that would recognize cases like this, and
drop the reference.

This GC logic has been broken sofar, and remained unfixed. This commit
removes it altogther, replacing it with nothing. The rationale is that
simply because all refs to the bus have been dropped its queued messages
should *still* be written to the bus, even if the caller doesn't retain
any reference to either bus nor message. This means it was actually
wrong to attempt to clean up the bus in this case.

The proper way how applications should handle this is by explicitly
invoking sd_bus_close(), when they want busses to go away. This is
probably want they want to do anyway to avoid getting spurious
callbacks after they stopped using a bus.
2014-07-02 17:29:09 +02:00
Lennart Poettering
9a00f57a5b path: add new "systemd-path" utility for querying paths described in file-hierarchy(7)
This new tool is based on "sd-path", a new (so far unexported) API for
libsystemd, that can hopefully grow into a workable API covering /opt
and more one day.
2014-07-02 12:23:36 +02:00
Tom Gundersen
9e358851b4 networkd: netdev - add dummy support 2014-07-01 22:10:07 +02:00
Lennart Poettering
5d3de3fe9c socket-util: introduce in_addr_union similar to sockaddr_union and make use of it everywhere 2014-06-18 18:28:29 +02:00
Susant Sahani
6ef8147700 sd-rtnl: add support for vxlan rtnl attributes
This patch adds vxlan rtnl attributes to sd-rtnl
2014-06-16 20:38:22 +02:00
Lennart Poettering
42a04ee69c build-sys: update library versions 2014-06-11 15:30:28 +02:00
Lennart Poettering
2a0958d2d0 sd-bus: don't allow creating message objects that are not attached to a bus
It seems unnecessary to support this, and we rather should avoid
allowing this at all, so that people don't program against this
sloppily and we end up remarshalling all the time...
2014-06-06 18:30:01 +02:00
Lennart Poettering
be8f4e9e8e sd-daemon: introduce sd_pid_notify() and sd_pid_notifyf()
sd_pid_notify() operates like sd_notify(), however operates on a
different PID (for example the parent PID of a process).

Make use of this in systemd-notify, so that message are sent from the
PID specified with --pid= rather than the usually shortlived PID of
systemd-notify itself.

This should increase the likelyhood that PID 1 can identify the cgroup
that the notification message was sent from properly.
2014-06-05 17:05:18 +02:00
Lennart Poettering
b27adf354a bus: make use of sd_bus_try_close() in exit-on-idle services 2014-06-05 13:50:35 +02:00
Lennart Poettering
eec6022cf0 sd-event: restore correct timeout behaviour 2014-06-05 13:50:35 +02:00
Lennart Poettering
a4152e3fe2 kdbus: when uploading bus name policy, resolve users/groups out-of-process
It's not safe invoking NSS from PID 1, hence fork off worker processes
that upload the policy into the kernel for busnames.
2014-06-05 13:09:46 +02:00
Susant Sahani
a613382bbf networkd: introduce vti tunnel
This patch enables vti tunnel support.

example conf:

file : vti.netdev
[NetDev]
Name=vti-tun
Kind=vti
MTUBytes=1480

[Tunnel]
Local=X.X.X.X
Remote=X.X.X.X

file: vti.network
[Match]
Name=em1

[Network]
Tunnel=vti-tun

TODO:

Add more attributes for vti tunnel
IFLA_VTI_IKEY
IFLA_VTI_OKEY
2014-06-02 16:20:44 +02:00
Susant Sahani
8bb088c5d4 networkd: introduce gre tunnel
This patch enables gre tunnel support.

example conf:

file : gre.netdev
[NetDev]
Name=gre-tun
Kind=gre
MTUBytes=1480

[Tunnel]
Local=X.X.X.X
Remote=X.X.X.X

file: gre.network
[Match]
Name=em1

[Network]
Tunnel=gre-tun

TODO:

Add more attributes for gre tunnel
IFLA_GRE_IFLAGS
IFLA_GRE_IFLAGS
IFLA_GRE_IKEY
IFLA_GRE_OKEY
2014-06-02 16:13:00 +02:00
Kay Sievers
82d115d9ab timedated: refuse manual system time updates when automatic timesync is enabled 2014-05-24 10:45:44 +08:00
Lennart Poettering
9a05490933 cgroups: simplify CPUQuota= logic
Only accept cpu quota values in percentages, get rid of period
definition.

It's not clear whether the CFS period controllable per-cgroup even has a
future in the kernel, hence let's simplify all this, hardcode the period
to 100ms and only accept percentage based quota values.
2014-05-22 11:53:12 +09:00
Lennart Poettering
a077b666cb sd-login: add C API to query primary session of a user 2014-05-19 09:33:20 +09:00
Lennart Poettering
878cd7e95c machined: add logic to query IP addresses of containers 2014-05-18 20:52:49 +09:00
Zbigniew Jędrzejewski-Szmek
2915234da0 bus: fix unitialized variable access in error path 2014-05-16 18:03:00 -04:00
Lennart Poettering
7e28adeb63 sd-bus: make sure we properly handle NULL callback functions 2014-05-15 18:09:20 +02:00
Lennart Poettering
b98490f7dc sd-bus: fix an assert when running in kdbus mode 2014-05-15 17:42:39 +02:00
Lennart Poettering
f2e2415d69 resolve: fix copy/paste error 2014-05-15 17:31:14 +02:00
Lennart Poettering
9e7e9a6524 sd-bus: don't hit assert when installing match 2014-05-15 17:26:02 +02:00
Lennart Poettering
1b64f83829 sd-bus: always keep slot reference while dispatching callback
Also, make sure we automatically destroy reply callbacks that are
floating.
2014-05-15 17:13:05 +02:00
Lennart Poettering
4a134c4903 sd-resolve: add "floating" resolve queries
Same story as for sd-bus and sd-event: allow passing NULL to store query
in in which case the query is freed automatically.
2014-05-15 17:13:05 +02:00
Lennart Poettering
a71fe8b8ae sd-event: introduce concept of "floating" event sources
These are the counterpart of "floating" bus slots, i.e. event sources
that are bound to the lifetime of the event object itself, and thus
don't require an explicit reference to be kept.
2014-05-15 17:13:04 +02:00
Zbigniew Jędrzejewski-Szmek
de0671ee7f Remove unnecessary casts in printfs
No functional change expected :)
2014-05-15 15:29:58 +02:00
Lennart Poettering
19befb2d5f sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables attached to a bus connection
This makes callback behaviour more like sd-event or sd-resolve, and
creates proper object for unregistering callbacks.

Taking the refernce to the slot is optional. If not taken life time of
the slot will be bound to the underlying bus object (or in the case of
an async call until the reply has been recieved).
2014-05-15 01:15:30 +02:00
Lennart Poettering
04552566fa bus: add userdata API for bus name tracker objects 2014-05-14 22:58:43 +02:00
Susant Sahani
7951dea209 networkd: introduce ipip tunnel
This patch enables basic ipip tunnel support.
It works with kernel module ipip

example conf:

file: ipip.netdev

[NetDev]
Name=ipip-tun
Kind=ipip
MTUBytes=1480

[Tunnel]
Local=192.168.223.238
Remote=192.169.224.239
TTL=64

file: ipip.network

[Match]
Name=em1

[Network]
Tunnel=ipip-tun

[tomegun:
         - drop unused variable
         - take ref when enslaving]
2014-05-12 17:37:12 +02:00
Tom Gundersen
8fe65c03fc rtnl: message - fix check for broadcast messages 2014-05-10 20:56:37 +02:00
Tom Gundersen
66269b05cf rtnl: message - read group membership of incoming messages 2014-05-10 20:56:37 +02:00
Tom Gundersen
26349add97 rtnl: message - verify that we read the pending message size from the kernel
Reuse the auth-checking for both the peek and the real read.
2014-05-10 20:56:37 +02:00
Tom Gundersen
127dc4ea94 rtnl: message - move code around
No functional change.
2014-05-10 20:56:37 +02:00
Tom Gundersen
897e184c7d rtnl: change from bitmask to enum for rtnl groups
The bitmask is deprecated in the kernel, so move to the new interface. At the moment
this does not make a difference for us, but it avoids having to change the API in the future.
2014-05-10 20:56:37 +02:00
Tom Gundersen
f4e884dd1c sd-rtnl: message - add support for getting prefixlen from address messages 2014-05-10 20:56:37 +02:00
Lennart Poettering
73dec31974 sd-resolve: make sure we can destroy a query object from its own callback handler 2014-05-05 23:49:19 +02:00
Lennart Poettering
cc567911ba sd-event: allow disabling event sources when an event object is dying anyway 2014-05-05 23:48:25 +02:00
Lennart Poettering
59bc1fd776 sd-event: make it easy to bind signal handling to event loop exits
By passing a NULL callback provide a simple way to make event loops exit
on SIGTERM and other signals.
2014-05-05 23:47:59 +02:00
Tom Gundersen
7ca1d31964 sd-rtnl-message: append - fix uninitialized memory
We were not properly clearing the padding at the front of some containers.
2014-05-03 18:14:42 +02:00
Tom Gundersen
3f781aa8a0 sd-rtnl: route - allow setting multiple matching routes 2014-05-03 18:14:42 +02:00
Lennart Poettering
93f1bcf400 sd-resolve: rework sd-resolve to be callback based, similar in style to sd-bus and sd-event 2014-04-29 15:45:16 +02:00
Lennart Poettering
b2f8b02ec2 core: expose CFS CPU time quota as high-level unit properties 2014-04-25 13:27:25 +02:00
Kay Sievers
1d49b5aea9 bus: update kdbus.h 2014-04-24 10:36:19 +02:00
Daniel Buch
77c98a9eb1 test-resolve.c: Cleanup and make use of sockaddr_pretty() 2014-04-24 09:27:20 +02:00
Lennart Poettering
6b01f1d391 delta: draw arrows with draw_special_char()
Let's unify generation of unicode chars at one place.

Also, don't add an extra space into chars we print, except for the tree
chars where this is really necessary.
2014-04-23 19:06:39 +02:00
Lennart Poettering
1b02f30183 bus: simplification 2014-04-23 19:06:38 +02:00
Kay Sievers
26e376bfe3 bus: remove "on behalf" kdbus logic (ABI break) 2014-04-22 22:52:19 +02:00
Lukasz Skalski
6d6c604ac8 doc: fix items' names in PORTING-DBUS1 2014-04-20 23:06:48 -04:00
Thomas Hindoe Paaboel Andersen
6e37cd2f4a silence warnings 2014-04-21 00:03:22 +02:00
Tom Gundersen
6190b9f9d2 sd-rtnl: log when queues are exhausted 2014-04-20 10:28:28 +02:00
Tom Gundersen
d4ef4f46cf sd-rtnl: socet_read_message - make sure we only shrink the partial rqueue when processing multi-part message 2014-04-19 20:32:01 +02:00
Tom Gundersen
6e20c8f8fa sd-rtnl: message - expose DUMP flag in the api 2014-04-19 16:47:52 +02:00
Tom Gundersen
7182867e79 sd-rtnl: add multi-part message test 2014-04-19 16:47:52 +02:00
Tom Gundersen
4e996881b2 sd-rtnl: message - concatenate multi-part messages from different packets 2014-04-19 16:47:52 +02:00
Tom Gundersen
24a026737d sd-rtnl: message - don't put NULL message on rqueue
If nothing interesting was receieved we should not put anything on
the queue.
2014-04-19 16:47:52 +02:00
Tom Gundersen
6fc518838c sd-rtnl: message - make room for all pending messages, not just the first
Also, don't actually read any of the message when peeking, just get its length.
2014-04-19 16:47:52 +02:00
Tom Gundersen
b9ef681b04 sd-rtnl: message_addr - allow dumping of messages 2014-04-14 17:53:21 +02:00
Tom Gundersen
a88f77c406 sd-rtnl: socket_read - use a read buffer
Rather than allocating/freeing memory for each message read, keep a global read buffer
in the rtnl object. Also, rather than using a fixed size, peek at the pending message
header to get the message size and reallocate as necessary.
2014-04-14 17:53:21 +02:00
Tom Gundersen
1403f45ab6 sd-rtnl: multi-part message - store as linked-list rather than independent messages
This means the API can stay the same as for single-part messages by simply passing the head message around. Unrefing
the head of the linked list unrefs the whole list.
2014-04-14 17:53:21 +02:00
Tom Gundersen
e00d77ddd5 sd-rtnl: message_addr - expose a few more getters 2014-04-14 17:53:01 +02:00
Lennart Poettering
bdb65e785a build-sys: add Makefile symlink 2014-04-13 17:41:02 -07:00
Tom Gundersen
bc078e7163 sd-rtnl: use SO_PASSCRED
This unifies the socket handling with other sd-* libraries.
2014-04-11 00:52:23 +02:00
Kay Sievers
862bbf89c6 bus: catch up with kdbus changes (ABI break) 2014-04-10 13:27:23 -07:00
Kay Sievers
dec51b29f9 bus: update kdbus.h 2014-04-10 13:02:35 -07:00
Tom Gundersen
1b89cf5648 sd-rtnl: don't drop multi-part messages
We still only return the first message part in callback/synchronous calls.
2014-04-10 19:40:48 +02:00
Tom Gundersen
77768cbabc sd-rtnl: use GREEDY_REALLOC for message queues 2014-04-10 19:00:36 +02:00
Zbigniew Jędrzejewski-Szmek
0830ba6189 build-sys: add newly used if_link.h defines to missing.h
Reported-by: Arnaud Gaboury <arnaud.gaboury@gmail.com>
2014-04-05 13:18:36 -04:00
Susant Sahani
0a827d105d sd-rtnl: fix broken test cases and add support for tunnel
This patch fixes the broken test-cases for sd-rtnl and add support for ipip
and sit tunnel.

[tomegun: minor fixups]
2014-04-03 18:09:24 +02:00
Umut Tezduyar Lindskog
aba496a58a networkd: smooth transition from ipv4ll to dhcp address
Currently when both ipv4ll and dhcp are enabled, ipv4ll
address (if one has been claimed) is removed when dhcp
address is aquired. This is not the best thing to do
since there might be clients unaware of the removal
trying to communicate.

This patch provides a smooth transition between ipv4ll
and dhcp. If ipv4ll address was claimed [1] before dhcp,
address is marked as deprecated. Deprecated address is still
a valid address and packets can be received on it but address
cannot be selected as a source address. If dhcp lease cannot
be extended, then ipv4ll address is marked as valid again.

[1] If there is no collision, claiming IPv4LL takes between 4 to
7 seconds.
2014-04-03 16:00:25 +02:00
Tom Gundersen
689703f618 sd-rtnl: modernize a bit 2014-03-31 14:43:34 +02:00
Lukasz Skalski
5fa4ddb88c doc: fix items' names in PORTING-DBUS1 2014-03-31 14:23:49 +02:00
Steven Siloti
c8a7165f58 sd-rtnl: fix off-by-one
Also fix type parameter passed to new0
2014-03-31 09:54:37 +02:00
Tom Gundersen
3cbbb3e678 sd-rtnl: types - hook up bond types
Reported by Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
2014-03-29 23:53:03 +01:00
Tom Gundersen
0834ff93c3 sd-rtnl: message - fix clang compile warning 2014-03-29 23:52:03 +01:00
Tom Gundersen
aef0768e6c sd-rtnl: message - don't log about out-of-range attribute types
We will easily get these when running on newer kernels. However, we can safely ignore them as we
anyway don't know what to do with them.
2014-03-28 19:16:21 +01:00
Tom Gundersen
d8e538ecd9 sd-rtnl: rework rtnl type system
Use a static table with all the typing information, rather than repeated
switch statements. This should make it a lot simpler to add new types.

We need to keep all the type info to be able to create containers
without exposing their implementation details to the users of the library.

As a freebee we verify the types of appended/read attributes.

The API is extended to nicely deal with unions of container types.
2014-03-28 19:11:59 +01:00