diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2015-06-23 12:10:38 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2015-06-24 13:46:11 +0200 |
commit | 846a6b3d89aaf4ee2cece0f10148f675c4796841 (patch) | |
tree | 4a732c8e281a9dcc58691d4db9008c011c920242 /src/libsystemd/sd-netlink/netlink-message.c | |
parent | e7de105cf67dc8e4936043c4093c7b4119c9fc55 (diff) |
sd-netlink: don't treat NULL as root type-system
Explicitly export the root type-system to the type-system callers. This
avoids treating NULL as root, which for one really looks backwards (NULL
is usually a leaf, not root), and secondly prevents us from properly
debugging calling into non-nested types.
Also rename the root to "type_system_root". Once we support more than
rtnl, well will have to revisit that, anyway.
Diffstat (limited to 'src/libsystemd/sd-netlink/netlink-message.c')
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-message.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-message.c b/src/libsystemd/sd-netlink/netlink-message.c index e39e4c646c..a935b821f6 100644 --- a/src/libsystemd/sd-netlink/netlink-message.c +++ b/src/libsystemd/sd-netlink/netlink-message.c @@ -68,7 +68,7 @@ int message_new(sd_netlink *rtnl, sd_netlink_message **ret, uint16_t type) { size_t size; int r; - r = type_system_get_type(NULL, &nl_type, type); + r = type_system_get_type(&type_system_root, &nl_type, type); if (r < 0) return r; @@ -874,7 +874,7 @@ int sd_netlink_message_rewind(sd_netlink_message *m) { assert(m->hdr); - r = type_system_get_type(NULL, &nl_type, m->hdr->nlmsg_type); + r = type_system_get_type(&type_system_root, &nl_type, m->hdr->nlmsg_type); if (r < 0) return r; |