From: David Herrmann Date: Tue, 23 Jun 2015 10:03:10 +0000 (+0200) Subject: sd-netlink: don't treat type_system->count==0 as invalid X-Git-Tag: v222~78^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e7de105cf67dc8e4936043c4093c7b4119c9fc55;p=thirdparty%2Fsystemd.git 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). --- diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c index c4573b6090d..d22194ad717 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;