OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:55 +0000 (14:50 +0100)
commit59a7ecd9d20b2871c5402e11f813defe3d3151ee
tree6cbef90c4ce782a2563fba53a8477021519606ed
parentda5b8af2414c9d49cf2232951a27677d8d471000
bpf: fix the check that forwarding is enabled in bpf_ipv6_fib_lookup

[ Upstream commit 56f0f84e69c7a7f229dfa524b13b0ceb6ce9b09e ]

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: 87f5fc7e48dd ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/filter.c