Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195295
b: refs/heads/master
c: f2344a1
h: refs/heads/master
i:
  195293: 51f2a16
  195291: 4d1a221
  195287: e36de2f
  195279: 2bb03f4
  195263: 212813a
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed May 18, 2010
1 parent 8aec527 commit 5e66702
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4c5ff6a6fe794f102479db998c69054319279e3c
refs/heads/master: f2344a131bccdbfc5338e17fa71a807dee7944fa
29 changes: 24 additions & 5 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1406,10 +1406,27 @@ static void addrconf_dad_stop(struct inet6_ifaddr *ifp, int dad_failed)
ipv6_del_addr(ifp);
}

static int addrconf_dad_end(struct inet6_ifaddr *ifp)
{
int err = -ENOENT;

spin_lock(&ifp->state_lock);
if (ifp->state == INET6_IFADDR_STATE_DAD) {
ifp->state = INET6_IFADDR_STATE_POSTDAD;
err = 0;
}
spin_unlock(&ifp->state_lock);

return err;
}

void addrconf_dad_failure(struct inet6_ifaddr *ifp)
{
struct inet6_dev *idev = ifp->idev;

if (addrconf_dad_end(ifp))
return;

if (net_ratelimit())
printk(KERN_INFO "%s: IPv6 duplicate address %pI6c detected!\n",
ifp->idev->dev->name, &ifp->addr);
Expand Down Expand Up @@ -2712,6 +2729,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)

/* Flag it for later restoration when link comes up */
ifa->flags |= IFA_F_TENTATIVE;
ifa->state = INET6_IFADDR_STATE_DAD;

write_unlock_bh(&idev->lock);

Expand Down Expand Up @@ -2883,6 +2901,9 @@ static void addrconf_dad_timer(unsigned long data)
struct inet6_dev *idev = ifp->idev;
struct in6_addr mcaddr;

if (!ifp->probes && addrconf_dad_end(ifp))
goto out;

read_lock(&idev->lock);
if (idev->dead || !(idev->if_flags & IF_READY)) {
read_unlock(&idev->lock);
Expand Down Expand Up @@ -2956,12 +2977,10 @@ static void addrconf_dad_run(struct inet6_dev *idev)
read_lock_bh(&idev->lock);
list_for_each_entry(ifp, &idev->addr_list, if_list) {
spin_lock(&ifp->lock);
if (!(ifp->flags & IFA_F_TENTATIVE)) {
spin_unlock(&ifp->lock);
continue;
}
if (ifp->flags & IFA_F_TENTATIVE &&
ifp->state == INET6_IFADDR_STATE_DAD)
addrconf_dad_kick(ifp);
spin_unlock(&ifp->lock);
addrconf_dad_kick(ifp);
}
read_unlock_bh(&idev->lock);
}
Expand Down

0 comments on commit 5e66702

Please sign in to comment.