mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
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).
This commit is contained in:
parent
12b7dff45b
commit
e7de105cf6
@ -598,7 +598,7 @@ int type_system_union_protocol_get_type_system(const NLTypeSystemUnion *type_sys
|
|||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
type_system = &type_system_union->type_systems[protocol];
|
type_system = &type_system_union->type_systems[protocol];
|
||||||
if (type_system->count == 0)
|
if (!type_system->types)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
*ret = type_system;
|
*ret = type_system;
|
||||||
|
Loading…
Reference in New Issue
Block a user