]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/bpf: Fix compiling kfree_skb.c with musl-libc
authorTony Ambardar <tony.ambardar@gmail.com>
Tue, 23 Jul 2024 05:54:39 +0000 (22:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:32:52 +0000 (16:32 +0200)
commitc1716c2c8b77b7b2c26ec6ebe6c1050d16a01b73
tree63a7c9c286bcb5d696f410f64e4444367d7c2f65
parent371a0c22b81a6cc26533684e8ac0cd5e6ac1e32f
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>
tools/testing/selftests/bpf/prog_tests/kfree_skb.c