summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorTony Ambardar <tony.ambardar@gmail.com>2024-07-22 22:54:39 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-17 15:07:49 +0200
commit306efef84bbf4502d2e24b7954ffdcffe23e985a (patch)
tree6f2146989cc192a73ec5e2421351cd18253fbc90 /tools/testing
parentcc52d5282a141e93d6562c998cffd1999acd18b3 (diff)
downloadlinux-306efef84bbf4502d2e24b7954ffdcffe23e985a.tar.gz
linux-306efef84bbf4502d2e24b7954ffdcffe23e985a.tar.bz2
linux-306efef84bbf4502d2e24b7954ffdcffe23e985a.zip
selftests/bpf: Fix compiling kfree_skb.c with musl-libc
[ Upstream commit bae9a5ce7d3a9b3a9e07b31ab9e9c58450e3e9fd ] 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: 580d656d80cf ("selftests/bpf: Add kfree_skb raw_tp test") Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/e2d8cedc790959c10d6822a51f01a7a3616bea1b.1721713597.git.tony.ambardar@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/kfree_skb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/kfree_skb.c b/tools/testing/selftests/bpf/prog_tests/kfree_skb.c
index 42c3a3103c26..a37b1d663f96 100644
--- a/tools/testing/selftests/bpf/prog_tests/kfree_skb.c
+++ b/tools/testing/selftests/bpf/prog_tests/kfree_skb.c
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
+#define _GNU_SOURCE
#include <test_progs.h>
#include <network_helpers.h>