bpftool icon indicating copy to clipboard operation
bpftool copied to clipboard

error: ‘NFPROTO_NETDEV’ undeclared here (not in a function); did you mean ‘NFPROTO_DECNET’?

Open InputOutputZ opened this issue 4 months ago • 4 comments

Environment

  • bpftool version: 7.6.0
  • Linux kernel version: 6.9.7
  • (optionally) clang/LLVM version: 4.8.5
  • ...

Describe the bug

I tried to compile bpf tool on Linux 6.9.7 Kernel and it thows

...                        libbfd: [ OFF ]
...               clang-bpf-co-re: [ OFF ]
...                          llvm: [ OFF ]
...                        libcap: [ on  ]
  CC       link.o
link.c:660:10: error: ‘NFPROTO_NETDEV’ undeclared here (not in a function); did you mean ‘NFPROTO_DECNET’?
  660 |         [NFPROTO_NETDEV] = "netdev",
      |          ^~~~~~~~~~~~~~
      |          NFPROTO_DECNET
link.c:660:10: error: array index in initializer not of integer type
link.c:660:10: note: (near initialization for ‘pf2name’)
make: *** [Makefile:253: link.o] Error 1

I checked netfilter header file and its missing netdev enum entry yet I understood from online sources that bpftool doesn't rely on netfilter and wondered why do I get this error?

Is there any workaround to get bpf compiled? if not which linux kernels are compatible with bpftool?

Looking forward for any ideas, with thanks.

Zak.

InputOutputZ avatar Aug 16 '25 11:08 InputOutputZ