]> granicus.if.org Git - strace/commit
net: fix SOL_NETLINK NETLINK_LIST_MEMBERSHIPS decoding
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 16 Nov 2017 02:27:40 +0000 (02:27 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 16 Nov 2017 02:27:40 +0000 (02:27 +0000)
commitba41dc8a7009f9f28548c8fc980f15b9c671c754
treee9a86c8a45e043927b59470c82dc70e44428a0b4
parent8d481bf4c21e61a827658a10e1120f1c59b92e89
net: fix SOL_NETLINK NETLINK_LIST_MEMBERSHIPS decoding

NETLINK_LIST_MEMBERSHIPS, unlike all other SOL_NETLINK options, requests
not just a single integer but an array of integers.  The kernel also
supports a zero optlen NETLINK_LIST_MEMBERSHIPS request.

* net.c (print_uint32): New function.
(print_getsockopt): Add ulen argument, rename len argument to rlen,
<SOL_NETLINK> Handle NETLINK_LIST_MEMBERSHIPS using print_array
and print_uint32.
(SYS_FUNC(getsockopt)): Pass ulen to print_getsockopt.
* tests/sockopt-sol_netlink.c (main): Check NETLINK_LIST_MEMBERSHIPS
decoding.
net.c
tests/sockopt-sol_netlink.c