]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipv6: add fib6_nh_release_dsts stub
authorNikolay Aleksandrov <nikolay@nvidia.com>
Mon, 22 Nov 2021 15:15:12 +0000 (17:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Dec 2021 08:04:49 +0000 (09:04 +0100)
commit6dce8d73407d72bf8020968e0ed01ff92d55e5b3
treeff2bac82a509596fa3a06746e4d2d51029acdbb9
parentbdedec090e8b3241bbf690cf6fce68391150c316
net: ipv6: add fib6_nh_release_dsts stub

[ Upstream commit b45db34f3a20ccbe7d1387f830fb8327a760d09b ]

We need a way to release a fib6_nh's per-cpu dsts when replacing
nexthops otherwise we can end up with stale per-cpu dsts which hold net
device references, so add a new IPv6 stub called fib6_nh_release_dsts.
It must be used after an RCU grace period, so no new dsts can be created
through a group's nexthop entry.
Similar to fib6_nh_release it shouldn't be used if fib6_nh_init has failed
so it doesn't need a dummy stub when IPv6 is not enabled.

Fixes: a5af64c1c96a ("nexthops: add support for replace")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/ip6_fib.h
include/net/ipv6_stubs.h
net/ipv6/af_inet6.c
net/ipv6/route.c