diff options
author | John Fastabend <john.r.fastabend@intel.com> | 2010-11-15 15:29:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-16 12:24:58 -0500 |
commit | 9d82ca98f71fd686ef2f3017c5e3e6a4871b6e46 (patch) | |
tree | dab771a2353d94604f0e3c8bcb6ef2cf9eda10c3 /net/ipv6/addrconf.c | |
parent | b5e4156743c5d42b736936be7a9ee8d72e0e4ac9 (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/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index b41ce0f0d514..aaa3ca448d08 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -2754,13 +2754,13 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2754 | ifa->state = INET6_IFADDR_STATE_DEAD; | 2754 | ifa->state = INET6_IFADDR_STATE_DEAD; |
2755 | spin_unlock_bh(&ifa->state_lock); | 2755 | spin_unlock_bh(&ifa->state_lock); |
2756 | 2756 | ||
2757 | if (state == INET6_IFADDR_STATE_DEAD) { | 2757 | if (state != INET6_IFADDR_STATE_DEAD) { |
2758 | in6_ifa_put(ifa); | ||
2759 | } else { | ||
2760 | __ipv6_ifa_notify(RTM_DELADDR, ifa); | 2758 | __ipv6_ifa_notify(RTM_DELADDR, ifa); |
2761 | atomic_notifier_call_chain(&inet6addr_chain, | 2759 | atomic_notifier_call_chain(&inet6addr_chain, |
2762 | NETDEV_DOWN, ifa); | 2760 | NETDEV_DOWN, ifa); |
2763 | } | 2761 | } |
2762 | |||
2763 | in6_ifa_put(ifa); | ||
2764 | write_lock_bh(&idev->lock); | 2764 | write_lock_bh(&idev->lock); |
2765 | } | 2765 | } |
2766 | } | 2766 | } |