Yonghong Song
34d67ecf3d
selftests/bpf: Fix sockopt_sk selftest
...
[ Upstream commit 69844e335d8c22454746c7903776533d8b4ab8fa ]
Commit f4e4534850a9 ("net/netlink: fix NETLINK_LIST_MEMBERSHIPS length report")
fixed NETLINK_LIST_MEMBERSHIPS length report which caused
selftest sockopt_sk failure. The failure log looks like
test_sockopt_sk:PASS:join_cgroup /sockopt_sk 0 nsec
run_test:PASS:skel_load 0 nsec
run_test:PASS:setsockopt_link 0 nsec
run_test:PASS:getsockopt_link 0 nsec
getsetsockopt:FAIL:Unexpected NETLINK_LIST_MEMBERSHIPS value unexpected Unexpected NETLINK_LIST_MEMBERSHIPS value: actual 8 != expected 4
run_test:PASS:getsetsockopt 0 nsec
#201 sockopt_sk:FAIL
In net/netlink/af_netlink.c, function netlink_getsockopt(), for NETLINK_LIST_MEMBERSHIPS,
nlk->ngroups equals to 36. Before Commit f4e4534850a9, the optlen is calculated as
ALIGN(nlk->ngroups / 8, sizeof(u32)) = 4
After that commit, the optlen is
ALIGN(BITS_TO_BYTES(nlk->ngroups), sizeof(u32)) = 8
Fix the test by setting the expected optlen to be 8.
Fixes: f4e4534850a9 ("net/netlink: fix NETLINK_LIST_MEMBERSHIPS length report")
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230606172202.1606249-1-yhs@fb.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-14 11:13:02 +02:00
..
2023-05-11 23:00:20 +09:00
2023-03-30 12:47:47 +02:00
2023-05-11 23:00:27 +09:00
2023-03-17 08:49:03 +01:00
2023-02-01 08:27:29 +01:00
2023-03-11 13:57:34 +01:00
2023-06-05 09:21:19 +02:00
2021-08-13 08:58:11 -06:00
2022-08-11 13:07:51 +02:00
2023-04-20 12:13:54 +02:00
2021-07-27 11:48:55 -07:00
2023-05-11 23:00:35 +09:00
2021-08-05 11:01:30 +01:00
2023-05-17 11:50:21 +02:00
2023-05-24 17:36:49 +01:00
2023-06-14 11:13:02 +02:00
2022-08-17 14:24:15 +02:00
2021-11-18 19:16:19 +01:00
2021-09-14 10:31:41 +02:00
2023-02-22 12:57:01 +01:00
2022-12-08 11:28:42 +01:00