Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184020
b: refs/heads/master
c: dc2b99f
h: refs/heads/master
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed Feb 12, 2010
1 parent 05a1ab9 commit 8b111ed
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 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: c0ad98453f23b98f73a1f1be2a75303a6c0dee4c
refs/heads/master: dc2b99f71ef477a31020511876ab4403fb7c4420
35 changes: 24 additions & 11 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2646,7 +2646,8 @@ static int addrconf_ifdown(struct net_device *dev, int how)

write_lock_bh(&addrconf_hash_lock);
while ((ifa = *bifa) != NULL) {
if (ifa->idev == idev) {
if (ifa->idev == idev &&
(how || !(ifa->flags&IFA_F_PERMANENT))) {
*bifa = ifa->lst_next;
ifa->lst_next = NULL;
addrconf_del_timer(ifa);
Expand Down Expand Up @@ -2686,18 +2687,30 @@ static int addrconf_ifdown(struct net_device *dev, int how)
write_lock_bh(&idev->lock);
}
#endif
while ((ifa = idev->addr_list) != NULL) {
idev->addr_list = ifa->if_next;
ifa->if_next = NULL;
ifa->dead = 1;
addrconf_del_timer(ifa);
write_unlock_bh(&idev->lock);
bifa = &idev->addr_list;
while ((ifa = *bifa) != NULL) {
if (how == 0 && (ifa->flags&IFA_F_PERMANENT)) {
/* Retain permanent address on admin down */
bifa = &ifa->if_next;

/* Restart DAD if needed when link comes back up */
if ( !((dev->flags&(IFF_NOARP|IFF_LOOPBACK)) ||
idev->cnf.accept_dad <= 0 ||
(ifa->flags & IFA_F_NODAD)))
ifa->flags |= IFA_F_TENTATIVE;
} else {
*bifa = ifa->if_next;
ifa->if_next = NULL;

__ipv6_ifa_notify(RTM_DELADDR, ifa);
atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifa);
in6_ifa_put(ifa);
ifa->dead = 1;
write_unlock_bh(&idev->lock);

write_lock_bh(&idev->lock);
__ipv6_ifa_notify(RTM_DELADDR, ifa);
atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifa);
in6_ifa_put(ifa);

write_lock_bh(&idev->lock);
}
}
write_unlock_bh(&idev->lock);

Expand Down

0 comments on commit 8b111ed

Please sign in to comment.