Revert "net: nexthop: release IPv6 per-cpu dsts when replacing a nexthop group"

This reverts commit 26ed13d064 which is
commit 1005f19b9357b81aa64e1decd08d6e332caaa284 upstream.

This is not needed for Android systems and is part of a patch series
that breaks the abi, so revert it.

Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id328fa580aef11e281542d0bda5d4f74861a98b4
This commit is contained in:
Greg Kroah-Hartman
2021-12-02 15:56:34 +01:00
parent 65836a68d9
commit 0bf59ac0b2

View File

@@ -924,36 +924,15 @@ static void remove_nexthop(struct net *net, struct nexthop *nh,
/* if any FIB entries reference this nexthop, any dst entries /* if any FIB entries reference this nexthop, any dst entries
* need to be regenerated * need to be regenerated
*/ */
static void nh_rt_cache_flush(struct net *net, struct nexthop *nh, static void nh_rt_cache_flush(struct net *net, struct nexthop *nh)
struct nexthop *replaced_nh)
{ {
struct fib6_info *f6i; struct fib6_info *f6i;
struct nh_group *nhg;
int i;
if (!list_empty(&nh->fi_list)) if (!list_empty(&nh->fi_list))
rt_cache_flush(net); rt_cache_flush(net);
list_for_each_entry(f6i, &nh->f6i_list, nh_list) list_for_each_entry(f6i, &nh->f6i_list, nh_list)
ipv6_stub->fib6_update_sernum(net, f6i); ipv6_stub->fib6_update_sernum(net, f6i);
/* if an IPv6 group was replaced, we have to release all old
* dsts to make sure all refcounts are released
*/
if (!replaced_nh->is_group)
return;
/* new dsts must use only the new nexthop group */
synchronize_net();
nhg = rtnl_dereference(replaced_nh->nh_grp);
for (i = 0; i < nhg->num_nh; i++) {
struct nh_grp_entry *nhge = &nhg->nh_entries[i];
struct nh_info *nhi = rtnl_dereference(nhge->nh->nh_info);
if (nhi->family == AF_INET6)
ipv6_stub->fib6_nh_release_dsts(&nhi->fib6_nh);
}
} }
static int replace_nexthop_grp(struct net *net, struct nexthop *old, static int replace_nexthop_grp(struct net *net, struct nexthop *old,
@@ -1132,7 +1111,7 @@ static int replace_nexthop(struct net *net, struct nexthop *old,
err = replace_nexthop_single(net, old, new, extack); err = replace_nexthop_single(net, old, new, extack);
if (!err) { if (!err) {
nh_rt_cache_flush(net, old, new); nh_rt_cache_flush(net, old);
__remove_nexthop(net, new, NULL); __remove_nexthop(net, new, NULL);
nexthop_put(new); nexthop_put(new);