summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-netlink/netlink-socket.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-06-23 11:03:10 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2015-06-24 13:45:47 +0200
commit817d1cd824bedba8feeef24c9724ec8bd160a7b2 (patch)
tree80730ddac6f615441e43708f243d7a44de7bcf03 /src/libsystemd/sd-netlink/netlink-socket.c
parentc658008f50fdbc617e6f7ad321c058f3a6f175f5 (diff)
sd-netlink: make NLType internal
If we extend NLType to support arrays and further extended types, we really want to avoid hard-coding the type-layout outside of netlink-types.c. We already avoid accessing nl_type->type_system outside of netlink-types.c, extend this to also avoid accessing any other fields. Provide accessor functions for nl_type->type and nl_type->size and then move NLType away from the type-system header. With this in place, follow-up patches can safely turn "type_system" and "type_system_union" into a real "union { }", and then add another type for arrays.
Diffstat (limited to 'src/libsystemd/sd-netlink/netlink-socket.c')
-rw-r--r--src/libsystemd/sd-netlink/netlink-socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-socket.c b/src/libsystemd/sd-netlink/netlink-socket.c
index 8136cf36ae..db4efb58d4 100644
--- a/src/libsystemd/sd-netlink/netlink-socket.c
+++ b/src/libsystemd/sd-netlink/netlink-socket.c
@@ -253,7 +253,7 @@ int socket_read_message(sd_netlink *rtnl) {
}
/* check that the size matches the message type */
- if (new_msg->nlmsg_len < NLMSG_LENGTH(nl_type->size)) {
+ if (new_msg->nlmsg_len < NLMSG_LENGTH(type_get_size(nl_type))) {
log_debug("sd-netlink: message larger than expected, dropping");
continue;
}