]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix link error without CONFIG_NET
authorArnd Bergmann <arnd@arndb.de>
Thu, 2 Nov 2017 11:05:51 +0000 (12:05 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Nov 2017 05:20:22 +0000 (14:20 +0900)
commit4c4adf6bf01245e149e2c930f1cf68747c52c9be
tree1daa70e8a2317ba6ffdff83c7bd0c076717e4774
parenta105da49b068478c15377b47132336afd4092ae0
bpf: fix link error without CONFIG_NET

I ran into this link error with the latest net-next plus linux-next
trees when networking is disabled:

kernel/bpf/verifier.o:(.rodata+0x2958): undefined reference to `tc_cls_act_analyzer_ops'
kernel/bpf/verifier.o:(.rodata+0x2970): undefined reference to `xdp_analyzer_ops'

It seems that the code was written to deal with varying contents of
the arrray, but the actual #ifdef was missing. Both tc_cls_act_analyzer_ops
and xdp_analyzer_ops are defined in the core networking code, so adding
a check for CONFIG_NET seems appropriate here, and I've verified this with
many randconfig builds

Fixes: 244648cdf59a ("bpf: move knowledge about post-translation offsets out of verifier")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/verifier.c