]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/bpf: Fix compiling tcp_rtt.c with musl-libc
authorTony Ambardar <tony.ambardar@gmail.com>
Tue, 23 Jul 2024 05:54:41 +0000 (22:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:10:56 +0000 (15:10 +0200)
commite0fcf564cb6cd56f3b84665fa52400a6bdd7a5bf
tree3c7cb8343c36e4edfec372da4c32f3704640c3ba
parenta445d939a91c705d00e2df44e97f0a24ffb1e1e2
selftests/bpf: Fix compiling tcp_rtt.c with musl-libc

[ Upstream commit 18826fb0b79c3c3cd1fe765d85f9c6f1a902c722 ]

The GNU version of 'struct tcp_info' in 'netinet/tcp.h' is not exposed by
musl headers unless _GNU_SOURCE is defined.

Add this definition to fix errors seen compiling for mips64el/musl-libc:

  tcp_rtt.c: In function 'wait_for_ack':
  tcp_rtt.c:24:25: error: storage size of 'info' isn't known
     24 |         struct tcp_info info;
        |                         ^~~~
  tcp_rtt.c:24:25: error: unused variable 'info' [-Werror=unused-variable]
  cc1: all warnings being treated as errors

Fixes: 1f4f80fed217 ("selftests/bpf: test_progs: convert test_tcp_rtt")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/f2329767b15df206f08a5776d35a47c37da855ae.1721713597.git.tony.ambardar@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/prog_tests/tcp_rtt.c