]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix the check that forwarding is enabled in bpf_ipv6_fib_lookup
authorAnton Protopopov <a.s.protopopov@gmail.com>
Sat, 15 Jun 2019 22:53:48 +0000 (22:53 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 17 Jun 2019 21:18:50 +0000 (23:18 +0200)
commita51fd9182cf7370a843dadd5069294a28e05a6f4
treeb3b55bdd26f17203126d7c9a1f4f7f0393c1c2e4
parent9a69e693adb896960664547608e973335e5a29fe
bpf: fix the check that forwarding is enabled in bpf_ipv6_fib_lookup

The bpf_ipv6_fib_lookup function should return BPF_FIB_LKUP_RET_FWD_DISABLED
when forwarding is disabled for the input device.  However instead of checking
if forwarding is enabled on the input device, it checked the global
net->ipv6.devconf_all->forwarding flag.  Change it to behave as expected.

Fixes: 7778ae3366be ("bpf: Provide helper to do forwarding lookups in kernel FIB table")
Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/core/filter.c