summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-06-23 12:03:10 +0200
committerSven Eden <yamakuzure@gmx.net>2017-03-14 10:04:18 +0100
commit84e862614a39d6e1d5d2317472175ec79bbc769f (patch)
tree69c62d72c1a29bee10ef01fb37224f1db959e6af /src/libsystemd
parentb72bd2c20e0f9767c0bd0f1aff97d3a77ed681c5 (diff)
sd-netlink: don't treat type_system->count==0 as invalid
Empty type-systems are just fine. Avoid the nasty hack in union-type-systems that treat empty type-systems as invalid. Instead check for the actual types-array and make sure it's non-NULL (which is even true for empty type-systems, due to "empty_types" array).
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-netlink/netlink-types.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c
index c4573b609..d22194ad7 100644
--- a/src/libsystemd/sd-netlink/netlink-types.c
+++ b/src/libsystemd/sd-netlink/netlink-types.c
@@ -598,7 +598,7 @@ int type_system_union_protocol_get_type_system(const NLTypeSystemUnion *type_sys
return -EOPNOTSUPP;
type_system = &type_system_union->type_systems[protocol];
- if (type_system->count == 0)
+ if (!type_system->types)
return -EOPNOTSUPP;
*ret = type_system;