]> granicus.if.org Git - strace/commit
netlink: call get_fd_nl_family before nlmsghdr decoding
authorJingPiao Chen <chenjingpiao@gmail.com>
Tue, 8 Aug 2017 14:37:37 +0000 (22:37 +0800)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 8 Aug 2017 16:36:59 +0000 (16:36 +0000)
commit338f0592ae5cf6bf628ea2777dd19fefb9d89fed
treeb722528f961076a4d953ed9152378d14453d132a
parent15cc2f5364888cbcf270cfa814628a9127d06bfa
netlink: call get_fd_nl_family before nlmsghdr decoding

Prepare for decoding of NETLINK_KOBJECT_UEVENT.  Messages of the latter,
unlike traditional netlink families, don't contain a header at all.

* netlink.c (NL_FAMILY_*): Remove enum.
(get_fd_nl_family): Replace NL_FAMILY_ERROR with -1.
(decode_nlmsg_type): Update the comment.
Skip family specific type decoders for type < NLMSG_MIN_TYPE.
(decode_nlmsghdr_with_payload): Skip family specific decoders
for type < NLMSG_MIN_TYPE && type != NLMSG_DONE.
(print_nlmsghdr): Move get_fd_nl_family invocation ...
(decode_nlmsghdr_with_payload): ... here.
netlink.c