Skip to content

Commit 18826fb

Browse files
guidosarduccianakryiko
authored andcommitted
selftests/bpf: Fix compiling tcp_rtt.c with musl-libc
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: 1f4f80f ("selftests/bpf: test_progs: convert test_tcp_rtt") Signed-off-by: Tony Ambardar <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/f2329767b15df206f08a5776d35a47c37da855ae.1721713597.git.tony.ambardar@gmail.com
1 parent 5e4c43b commit 18826fb

File tree

1 file changed

+1
-0
lines changed
  • tools/testing/selftests/bpf/prog_tests

1 file changed

+1
-0
lines changed

tools/testing/selftests/bpf/prog_tests/tcp_rtt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0
2+
#define _GNU_SOURCE
23
#include <test_progs.h>
34
#include "cgroup_helpers.h"
45
#include "network_helpers.h"

0 commit comments

Comments
 (0)