]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix build error with clang
authorStefan Agner <stefan@agner.ch>
Mon, 27 Aug 2018 19:30:42 +0000 (21:30 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 28 Aug 2018 03:37:05 +0000 (20:37 -0700)
commit6cbccb1037848bd896bcc5c880acfd5da47257cf
tree88865bff5748dab42ec22cbab9756418abcfc647
parent25d088af752fb5c2e0aaed070bf5beea182785c3
bpf: fix build error with clang

Building the newly introduced BPF_PROG_TYPE_SK_REUSEPORT leads to
a compile time error when building with clang:
net/core/filter.o: In function `sk_reuseport_convert_ctx_access':
  ../net/core/filter.c:7284: undefined reference to `__compiletime_assert_7284'

It seems that clang has issues resolving hweight_long at compile
time. Since SK_FL_PROTO_MASK is a constant, we can use the interface
for known constant arguments which works fine with clang.

Fixes: ebe0a6fb91fb ("bpf: Introduce BPF_PROG_TYPE_SK_REUSEPORT")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/core/filter.c