chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-netlink: don't treat NULL as root type-system
[elogind.git]
/
src
/
libsystemd
/
sd-netlink
/
netlink-types.c
diff --git
a/src/libsystemd/sd-netlink/netlink-types.c
b/src/libsystemd/sd-netlink/netlink-types.c
index c4573b6090d11e7d425a8fde22ce23f9b6981d08..40548dcbc0ee79c56380b6c1d853925b622e76d8 100644
(file)
--- a/
src/libsystemd/sd-netlink/netlink-types.c
+++ b/
src/libsystemd/sd-netlink/netlink-types.c
@@
-476,7
+476,7
@@
static const NLType rtnl_types[RTM_MAX + 1] = {
[RTM_GETNEIGH] = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_neigh_type_system, .size = sizeof(struct ndmsg) },
};
[RTM_GETNEIGH] = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_neigh_type_system, .size = sizeof(struct ndmsg) },
};
-const NLTypeSystem
rtnl_type_system
= {
+const NLTypeSystem
type_system_root
= {
.count = ELEMENTSOF(rtnl_types),
.types = rtnl_types,
};
.count = ELEMENTSOF(rtnl_types),
.types = rtnl_types,
};
@@
-518,10
+518,7
@@
int type_system_get_type(const NLTypeSystem *type_system, const NLType **ret, ui
const NLType *nl_type;
assert(ret);
const NLType *nl_type;
assert(ret);
-
- if (!type_system)
- type_system = &rtnl_type_system;
-
+ assert(type_system);
assert(type_system->types);
if (type >= type_system->count)
assert(type_system->types);
if (type >= type_system->count)
@@
-598,7
+595,7
@@
int type_system_union_protocol_get_type_system(const NLTypeSystemUnion *type_sys
return -EOPNOTSUPP;
type_system = &type_system_union->type_systems[protocol];
return -EOPNOTSUPP;
type_system = &type_system_union->type_systems[protocol];
- if (
type_system->count == 0
)
+ if (
!type_system->types
)
return -EOPNOTSUPP;
*ret = type_system;
return -EOPNOTSUPP;
*ret = type_system;