]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 3 Feb 2022 17:57:00 +0000 (18:57 +0100)
commit70e3648316e266b115bf92b426c3e65a6475bde6
treeee27abf88e4d8f195f661daf298b977d2a255402
parent6ede713aac6ef7e9bec0a0a4d378267fca4723f8
net: ipv6: add fib6_nh_release_dsts stub

BugLink: https://bugs.launchpad.net/bugs/1956380
[ Upstream commit 8837cbbf854246f5f4d565f21e6baa945d37aded ]

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: 7bf4796dd099 ("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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/net/ip6_fib.h
include/net/ipv6_stubs.h
net/ipv6/af_inet6.c
net/ipv6/route.c