Skip to content

Commit 5e4c43b

Browse files
guidosarduccianakryiko
authored andcommitted
selftests/bpf: Fix compiling flow_dissector.c with musl-libc
The GNU version of 'struct tcphdr' has members 'doff', 'source' and 'dest', which are not exposed by musl libc headers unless _GNU_SOURCE is defined. Add this definition to fix errors seen compiling for mips64el/musl-libc: flow_dissector.c:118:30: error: 'struct tcphdr' has no member named 'doff' 118 | .tcp.doff = 5, | ^~~~ flow_dissector.c:119:30: error: 'struct tcphdr' has no member named 'source' 119 | .tcp.source = 80, | ^~~~~~ flow_dissector.c:120:30: error: 'struct tcphdr' has no member named 'dest' 120 | .tcp.dest = 8080, | ^~~~ Fixes: ae173a9 ("selftests/bpf: support BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG") Signed-off-by: Tony Ambardar <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/8f7ab21a73f678f9cebd32b26c444a686e57414d.1721713597.git.tony.ambardar@gmail.com
1 parent bae9a5c commit 5e4c43b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/testing/selftests/bpf/prog_tests/flow_dissector.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 <network_helpers.h>
45
#include <linux/if_tun.h>

0 commit comments

Comments
 (0)