Skip to content

Commit 122e451

Browse files
stephen hemmingerdavem330
authored andcommitted
IPv6: addrconf dad timer unnecessary bh_disable
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>
1 parent e5c1a0a commit 122e451

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

net/ipv6/addrconf.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2850,9 +2850,9 @@ static void addrconf_dad_timer(unsigned long data)
28502850
struct inet6_dev *idev = ifp->idev;
28512851
struct in6_addr mcaddr;
28522852

2853-
read_lock_bh(&idev->lock);
2854-
if (idev->dead) {
2855-
read_unlock_bh(&idev->lock);
2853+
read_lock(&idev->lock);
2854+
if (idev->dead || !(idev->if_flags & IF_READY)) {
2855+
read_unlock(&idev->lock);
28562856
goto out;
28572857
}
28582858

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

28652865
ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED);
28662866
spin_unlock(&ifp->lock);
2867-
read_unlock_bh(&idev->lock);
2867+
read_unlock(&idev->lock);
28682868

28692869
addrconf_dad_completed(ifp);
28702870

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

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

0 commit comments

Comments
 (0)