aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2010-11-15 15:29:21 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-22 10:37:36 -0500
commit88b2a9a3d98a19496d64aadda7158c0ad51cbe7d (patch)
tree6e2fef13c006956efb6f592356d1c06874baf34c /net
parentddab1a3b30452bf6d2a2780dbb5fd962a85bec48 (diff)
ipv6: fix missing in6_ifa_put in addrconf
Fix ref count bug introduced by commit 2de795707294972f6c34bae9de713e502c431296 Author: Lorenzo Colitti <lorenzo@google.com> 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 <shemminger@vyatta.com> Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/addrconf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 2fc35b32df9e..23cc8e1ce8d4 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2758,13 +2758,13 @@ static int addrconf_ifdown(struct net_device *dev, int how)
2758 ifa->state = INET6_IFADDR_STATE_DEAD; 2758 ifa->state = INET6_IFADDR_STATE_DEAD;
2759 spin_unlock_bh(&ifa->state_lock); 2759 spin_unlock_bh(&ifa->state_lock);
2760 2760
2761 if (state == INET6_IFADDR_STATE_DEAD) { 2761 if (state != INET6_IFADDR_STATE_DEAD) {
2762 in6_ifa_put(ifa);
2763 } else {
2764 __ipv6_ifa_notify(RTM_DELADDR, ifa); 2762 __ipv6_ifa_notify(RTM_DELADDR, ifa);
2765 atomic_notifier_call_chain(&inet6addr_chain, 2763 atomic_notifier_call_chain(&inet6addr_chain,
2766 NETDEV_DOWN, ifa); 2764 NETDEV_DOWN, ifa);
2767 } 2765 }
2766
2767 in6_ifa_put(ifa);
2768 write_lock_bh(&idev->lock); 2768 write_lock_bh(&idev->lock);
2769 } 2769 }
2770 } 2770 }