From 846a6b3d89aaf4ee2cece0f10148f675c4796841 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Tue, 23 Jun 2015 12:10:38 +0200 Subject: 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. --- src/libsystemd/sd-netlink/netlink-socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsystemd/sd-netlink/netlink-socket.c') diff --git a/src/libsystemd/sd-netlink/netlink-socket.c b/src/libsystemd/sd-netlink/netlink-socket.c index db4efb58d4..84ff7c38c9 100644 --- a/src/libsystemd/sd-netlink/netlink-socket.c +++ b/src/libsystemd/sd-netlink/netlink-socket.c @@ -243,7 +243,7 @@ int socket_read_message(sd_netlink *rtnl) { } /* check that we support this message type */ - r = type_system_get_type(NULL, &nl_type, new_msg->nlmsg_type); + r = type_system_get_type(&type_system_root, &nl_type, new_msg->nlmsg_type); if (r < 0) { if (r == -EOPNOTSUPP) log_debug("sd-netlink: ignored message with unknown type: %i", -- cgit v1.2.3-54-g00ecf