Skip to content

Commit 27bdb2a

Browse files
stephen hemmingerdavem330
authored andcommitted
IPv6: keep tentative addresses in hash table
When link goes down, want address to be preserved but in a tentative state, therefore it has to stay in hash list. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 93fa159 commit 27bdb2a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

net/ipv6/addrconf.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,17 +2704,18 @@ static int addrconf_ifdown(struct net_device *dev, int how)
27042704
/* Flag it for later restoration when link comes up */
27052705
ifa->flags |= IFA_F_TENTATIVE;
27062706
in6_ifa_hold(ifa);
2707+
write_unlock_bh(&idev->lock);
27072708
} else {
27082709
list_del(&ifa->if_list);
27092710
ifa->dead = 1;
2710-
}
2711-
write_unlock_bh(&idev->lock);
2711+
write_unlock_bh(&idev->lock);
27122712

2713-
/* clear hash table */
2714-
spin_lock_bh(&addrconf_hash_lock);
2715-
hlist_del_init_rcu(&ifa->addr_lst);
2716-
__in6_ifa_put(ifa);
2717-
spin_unlock_bh(&addrconf_hash_lock);
2713+
/* clear hash table */
2714+
spin_lock_bh(&addrconf_hash_lock);
2715+
hlist_del_init_rcu(&ifa->addr_lst);
2716+
__in6_ifa_put(ifa);
2717+
spin_unlock_bh(&addrconf_hash_lock);
2718+
}
27182719

27192720
__ipv6_ifa_notify(RTM_DELADDR, ifa);
27202721
atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifa);

0 commit comments

Comments
 (0)