On 7/7/25 9:17 AM, Saket Kumar Bhaskar wrote:
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]>

Reply via email to