Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9602557 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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



This reverts commit 67a6f64a 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: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: Id328fa580aef11e281542d0bda5d4f74861a98b4
parent ac1da9a2
Loading
Loading
Loading
Loading
+2 −23
Original line number Diff line number Diff line
@@ -839,36 +839,15 @@ static void remove_nexthop(struct net *net, struct nexthop *nh,
/* if any FIB entries reference this nexthop, any dst entries
 * need to be regenerated
 */
static void nh_rt_cache_flush(struct net *net, struct nexthop *nh,
			      struct nexthop *replaced_nh)
static void nh_rt_cache_flush(struct net *net, struct nexthop *nh)
{
	struct fib6_info *f6i;
	struct nh_group *nhg;
	int i;

	if (!list_empty(&nh->fi_list))
		rt_cache_flush(net);

	list_for_each_entry(f6i, &nh->f6i_list, nh_list)
		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,
@@ -1015,7 +994,7 @@ static int replace_nexthop(struct net *net, struct nexthop *old,
		err = replace_nexthop_single(net, old, new, extack);

	if (!err) {
		nh_rt_cache_flush(net, old, new);
		nh_rt_cache_flush(net, old);

		__remove_nexthop(net, new, NULL);
		nexthop_put(new);