]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix sk_assign on s390x
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 24 Jul 2023 12:42:23 +0000 (15:42 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2023 06:50:51 +0000 (08:50 +0200)
commit268bfb37825623ae81d56015e5875d0e678a6a41
treed5e3e40353a4cdadd0a33bd312e9ff00c8a2d89a
parentfd1e31d1bcb7526f5dad933c12a133398abdc96f
selftests/bpf: Fix sk_assign on s390x

[ Upstream commit 7ce878ca81bca7811e669db4c394b86780e0dbe4 ]

sk_assign is failing on an s390x machine running Debian "bookworm" for
2 reasons: legacy server_map definition and uninitialized addrlen in
recvfrom() call.

Fix by adding a new-style server_map definition and dropping addrlen
(recvfrom() allows NULL values for src_addr and addrlen).

Since the test should support tc built without libbpf, build the prog
twice: with the old-style definition and with the new-style definition,
then select the right one at runtime. This could be done at compile
time too, but this would not be cross-compilation friendly.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/r/20230129190501.1624747-2-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/prog_tests/sk_assign.c
tools/testing/selftests/bpf/progs/test_sk_assign.c
tools/testing/selftests/bpf/progs/test_sk_assign_libbpf.c [new file with mode: 0644]