Commit 9d82ca98 authored by John Fastabend's avatar John Fastabend Committed by David S. Miller

ipv6: fix missing in6_ifa_put in addrconf

Fix ref count bug introduced by

commit 2de79570
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: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b5e41567
...@@ -2754,13 +2754,13 @@ static int addrconf_ifdown(struct net_device *dev, int how) ...@@ -2754,13 +2754,13 @@ static int addrconf_ifdown(struct net_device *dev, int how)
ifa->state = INET6_IFADDR_STATE_DEAD; ifa->state = INET6_IFADDR_STATE_DEAD;
spin_unlock_bh(&ifa->state_lock); spin_unlock_bh(&ifa->state_lock);
if (state == INET6_IFADDR_STATE_DEAD) { if (state != INET6_IFADDR_STATE_DEAD) {
in6_ifa_put(ifa);
} else {
__ipv6_ifa_notify(RTM_DELADDR, ifa); __ipv6_ifa_notify(RTM_DELADDR, ifa);
atomic_notifier_call_chain(&inet6addr_chain, atomic_notifier_call_chain(&inet6addr_chain,
NETDEV_DOWN, ifa); NETDEV_DOWN, ifa);
} }
in6_ifa_put(ifa);
write_lock_bh(&idev->lock); write_lock_bh(&idev->lock);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment