]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: bpf: Less strict size check in sockopt_sk
authorFelix Maurer <fmaurer@redhat.com>
Tue, 25 Jan 2022 16:58:23 +0000 (17:58 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 26 Jan 2022 02:25:05 +0000 (18:25 -0800)
commit778e4fc806a4abae649c1dca1ca6635406d810b1
treebab95f4c12d7a9566af92a7ae993017ad3a81d4c
parent09dd4dcf7ec1303d52cb62b66b83e789616572be
selftests: bpf: Less strict size check in sockopt_sk

Originally, the kernel strictly checked the size of the optval in
getsockopt(TCP_ZEROCOPY_RECEIVE) to be equal to sizeof(struct
tcp_zerocopy_receive). With 90763c2f00f28, this was changed to allow
optvals of different sizes.

The bpf code in the sockopt_sk test was still performing the strict size
check. This fix adapts the kernel behavior from 90763c2f00f28 in the
selftest, i.e., just check if the required fields are there.

Fixes: c5f4afe38a161 ("bpf: Remove extra lock_sock for TCP_ZEROCOPY_RECEIVE")
Signed-off-by: Felix Maurer <fmaurer@redhat.com>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/6f569cca2e45473f9a724d54d03fdfb45f29e35f.1643129402.git.fmaurer@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/sockopt_sk.c