Skip to content

Commit 9d82ca9

Browse files
John Fastabenddavem330
authored andcommitted
ipv6: fix missing in6_ifa_put in addrconf
Fix ref count bug introduced by commit 2de7957 Author: Lorenzo Colitti <[email protected]> Date: Wed Oct 27 18:16:49 2010 +0000 ipv6: addrconf: don't remove address state on ifdown if the address is being kept Fix logic so that addrconf_ifdown() decrements the inet6_ifaddr refcnt correctly with in6_ifa_put(). Reported-by: Stephen Hemminger <[email protected]> Signed-off-by: John Fastabend <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b5e4156 commit 9d82ca9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/ipv6/addrconf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,13 +2754,13 @@ static int addrconf_ifdown(struct net_device *dev, int how)
27542754
ifa->state = INET6_IFADDR_STATE_DEAD;
27552755
spin_unlock_bh(&ifa->state_lock);
27562756

2757-
if (state == INET6_IFADDR_STATE_DEAD) {
2758-
in6_ifa_put(ifa);
2759-
} else {
2757+
if (state != INET6_IFADDR_STATE_DEAD) {
27602758
__ipv6_ifa_notify(RTM_DELADDR, ifa);
27612759
atomic_notifier_call_chain(&inet6addr_chain,
27622760
NETDEV_DOWN, ifa);
27632761
}
2762+
2763+
in6_ifa_put(ifa);
27642764
write_lock_bh(&idev->lock);
27652765
}
27662766
}

0 commit comments

Comments
 (0)