[PATCH v2 1/3] netlink: call get_fd_nl_family before decode nlmsghdr

Dmitry V. Levin ldv at altlinux.org
Tue Aug 8 18:29:53 UTC 2017


On Tue, Aug 08, 2017 at 10:37:37PM +0800, JingPiao Chen wrote:
> Prepare for NETLINK_KOBJECT_UEVENT decode. The messages
> of NETLINK_KOBJECT_UEVENT do not contain nlmsghdr.
> 
> * netlink.c (NL_FAMILY_*): Remove enum.
> (get_fd_nl_family): Replace NL_FAMILY_ERROR with -1.
> (decode_nlmsg_type): Correct 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 call ...
> (decode_nlmsghdr_with_payload): ... here.
On Tue, Aug 08, 2017 at 10:39:21PM +0800, JingPiao Chen wrote:
> * netlink.c (decode_netlink): Call printstrn
> when family == NETLINK_KOBJECT_UEVENT.

Applied, thanks.

On Tue, Aug 08, 2017 at 10:39:22PM +0800, JingPiao Chen wrote:
> * tests/netlink_kobject_uevent.c: New file.
> * tests/gen_tests.in (netlink_kobject_uevent): New entry.
> * tests/pure_executables.list: Add netlink_kobject_uevent.
> * tests/.gitignore: Likewise.

I've extended and applied the test, thanks.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170808/3fc938ad/attachment.bin>


More information about the Strace-devel mailing list