Skip to content

Commit

Permalink
IPv6: addrconf dad timer unnecessary bh_disable
Browse files Browse the repository at this point in the history
Timer code runs in bottom half, so there is no need for
using _bh form of locking.  Also check if device is not ready
to avoid race with address that is no longer active.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
stephen hemminger authored and David S. Miller committed Mar 4, 2010
1 parent e5c1a0a commit 122e451
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2850,9 +2850,9 @@ static void addrconf_dad_timer(unsigned long data)
struct inet6_dev *idev = ifp->idev;
struct in6_addr mcaddr;

read_lock_bh(&idev->lock);
if (idev->dead) {
read_unlock_bh(&idev->lock);
read_lock(&idev->lock);
if (idev->dead || !(idev->if_flags & IF_READY)) {
read_unlock(&idev->lock);
goto out;
}

Expand All @@ -2864,7 +2864,7 @@ static void addrconf_dad_timer(unsigned long data)

ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED);
spin_unlock(&ifp->lock);
read_unlock_bh(&idev->lock);
read_unlock(&idev->lock);

addrconf_dad_completed(ifp);

Expand All @@ -2874,7 +2874,7 @@ static void addrconf_dad_timer(unsigned long data)
ifp->probes--;
addrconf_mod_timer(ifp, AC_DAD, ifp->idev->nd_parms->retrans_time);
spin_unlock(&ifp->lock);
read_unlock_bh(&idev->lock);
read_unlock(&idev->lock);

/* send a neighbour solicitation for our addr */
addrconf_addr_solict_mult(&ifp->addr, &mcaddr);
Expand Down

0 comments on commit 122e451

Please sign in to comment.