Skip to content

Commit 0f626c9

Browse files
Saket Kumar BhaskarAlexei Starovoitov
authored andcommitted
selftests/bpf: Set CONFIG_PACKET=y for selftests
BPF selftest fails to build with below error: CLNG-BPF [test_progs] lsm_cgroup.bpf.o progs/lsm_cgroup.c:105:21: error: variable has incomplete type 'struct sockaddr_ll' 105 | struct sockaddr_ll sa = {}; | ^ progs/lsm_cgroup.c:105:9: note: forward declaration of 'struct sockaddr_ll' 105 | struct sockaddr_ll sa = {}; | ^ 1 error generated. lsm_cgroup selftest requires sockaddr_ll structure which is not there in vmlinux.h when the kernel is built with CONFIG_PACKET=m. Enabling CONFIG_PACKET=y ensures that sockaddr_ll is available in vmlinux, allowing it to be captured in the generated vmlinux.h for bpf selftests. Reported-by: Sachin P Bappalige <[email protected]> Signed-off-by: Saket Kumar Bhaskar <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 0074250 commit 0f626c9

File tree

1 file changed

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

1 file changed

+1
-0
lines changed

tools/testing/selftests/bpf/config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ CONFIG_IP_NF_IPTABLES=y
105105
CONFIG_IP6_NF_IPTABLES=y
106106
CONFIG_IP6_NF_FILTER=y
107107
CONFIG_NF_NAT=y
108+
CONFIG_PACKET=y
108109
CONFIG_RC_CORE=y
109110
CONFIG_SECURITY=y
110111
CONFIG_SECURITYFS=y

0 commit comments

Comments
 (0)