Skip to content

Commit 6d26d98

Browse files
Florian WestphalAlexei Starovoitov
authored andcommitted
bpf: fix link failure with NETFILTER=y INET=n
Explicitly check if NETFILTER_BPF_LINK is enabled, else configs that have NETFILTER=y but CONFIG_INET=n fail to link: > kernel/bpf/syscall.o: undefined reference to `netfilter_prog_ops' > kernel/bpf/verifier.o: undefined reference to `netfilter_verifier_ops' Fixes: fd9c663 ("bpf: minimal support for programs hooked into netfilter framework") Reported-by: kernel test robot <[email protected]> Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Florian Westphal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent fbc1449 commit 6d26d98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/bpf_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ BPF_PROG_TYPE(BPF_PROG_TYPE_LSM, lsm,
7979
#endif
8080
BPF_PROG_TYPE(BPF_PROG_TYPE_SYSCALL, bpf_syscall,
8181
void *, void *)
82-
#ifdef CONFIG_NETFILTER
82+
#ifdef CONFIG_NETFILTER_BPF_LINK
8383
BPF_PROG_TYPE(BPF_PROG_TYPE_NETFILTER, netfilter,
8484
struct bpf_nf_ctx, struct bpf_nf_ctx)
8585
#endif

0 commit comments

Comments
 (0)