aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2005-12-27 16:35:15 -0500
committerDavid S. Miller <davem@davemloft.net>2005-12-27 16:35:15 -0500
commit6732badee0dad467fcc9dd0168af8677b2b1bc2f (patch)
tree43fd9fbb5759de0e4a182d473621699b1ff453bc
parent79cac2a221ce18642550a13bed0f0203514923ea (diff)
[IPV6]: Fix addrconf dead lock.
We need to release idev->lcok before we call addrconf_dad_stop(). It calls ipv6_addr_del(), which will hold idev->lock. Bug spotted by Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/addrconf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 2a6439e3c91c..a60585fd85ad 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2467,11 +2467,9 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags)
2467 return; 2467 return;
2468 } 2468 }
2469 2469
2470 if (idev->if_flags & IF_READY) { 2470 if (!(idev->if_flags & IF_READY)) {
2471 addrconf_dad_kick(ifp);
2472 spin_unlock_bh(&ifp->lock);
2473 } else {
2474 spin_unlock_bh(&ifp->lock); 2471 spin_unlock_bh(&ifp->lock);
2472 read_unlock_bh(&idev->lock);
2475 /* 2473 /*
2476 * If the defice is not ready: 2474 * If the defice is not ready:
2477 * - keep it tentative if it is a permanent address. 2475 * - keep it tentative if it is a permanent address.
@@ -2479,7 +2477,10 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags)
2479 */ 2477 */
2480 in6_ifa_hold(ifp); 2478 in6_ifa_hold(ifp);
2481 addrconf_dad_stop(ifp); 2479 addrconf_dad_stop(ifp);
2480 return;
2482 } 2481 }
2482 addrconf_dad_kick(ifp);
2483 spin_unlock_bh(&ifp->lock);
2483out: 2484out:
2484 read_unlock_bh(&idev->lock); 2485 read_unlock_bh(&idev->lock);
2485} 2486}