Skip to content

Commit bae9a5c

Browse files
guidosarduccianakryiko
authored andcommitted
selftests/bpf: Fix compiling kfree_skb.c with musl-libc
The GNU version of 'struct tcphdr' with member 'doff' is not exposed by musl headers unless _GNU_SOURCE is defined. Add this definition to fix errors seen compiling for mips64el/musl-libc: In file included from kfree_skb.c:2: kfree_skb.c: In function 'on_sample': kfree_skb.c:45:30: error: 'struct tcphdr' has no member named 'doff' 45 | if (CHECK(pkt_v6->tcp.doff != 5, "check_tcp", | ^ Fixes: 580d656 ("selftests/bpf: Add kfree_skb raw_tp test") Signed-off-by: Tony Ambardar <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/e2d8cedc790959c10d6822a51f01a7a3616bea1b.1721713597.git.tony.ambardar@gmail.com
1 parent 4c329b9 commit bae9a5c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/testing/selftests/bpf/prog_tests/kfree_skb.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 "kfree_skb.skel.h"

0 commit comments

Comments
 (0)