aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorBrian Haley <brian.haley@hp.com>2009-09-09 10:41:32 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-11 15:54:58 -0400
commitcc411d0bae9c19ec85a150aeab4b08335f5751d1 (patch)
treec42430cdb955c158d69fd9fef053c01130f8eb07 /net/ipv6/addrconf.c
parent384912ed194e43c03ad1cdaa09b0b1e488c34d46 (diff)
ipv6: Add IFA_F_DADFAILED flag
Add IFA_F_DADFAILED flag to denote an IPv6 address that has failed Duplicate Address Detection, that way tools like /sbin/ip can be more informative. 3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000 inet6 2001:db8::1/64 scope global tentative dadfailed valid_lft forever preferred_lft forever Signed-off-by: Brian Haley <brian.haley@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 43b3c9f89c12..c9b369034a40 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1371,12 +1371,14 @@ struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, const struct in6_addr *add
1371 1371
1372/* Gets referenced address, destroys ifaddr */ 1372/* Gets referenced address, destroys ifaddr */
1373 1373
1374static void addrconf_dad_stop(struct inet6_ifaddr *ifp) 1374static void addrconf_dad_stop(struct inet6_ifaddr *ifp, int dad_failed)
1375{ 1375{
1376 if (ifp->flags&IFA_F_PERMANENT) { 1376 if (ifp->flags&IFA_F_PERMANENT) {
1377 spin_lock_bh(&ifp->lock); 1377 spin_lock_bh(&ifp->lock);
1378 addrconf_del_timer(ifp); 1378 addrconf_del_timer(ifp);
1379 ifp->flags |= IFA_F_TENTATIVE; 1379 ifp->flags |= IFA_F_TENTATIVE;
1380 if (dad_failed)
1381 ifp->flags |= IFA_F_DADFAILED;
1380 spin_unlock_bh(&ifp->lock); 1382 spin_unlock_bh(&ifp->lock);
1381 in6_ifa_put(ifp); 1383 in6_ifa_put(ifp);
1382#ifdef CONFIG_IPV6_PRIVACY 1384#ifdef CONFIG_IPV6_PRIVACY
@@ -1422,7 +1424,7 @@ void addrconf_dad_failure(struct inet6_ifaddr *ifp)
1422 } 1424 }
1423 } 1425 }
1424 1426
1425 addrconf_dad_stop(ifp); 1427 addrconf_dad_stop(ifp, 1);
1426} 1428}
1427 1429
1428/* Join to solicited addr multicast group. */ 1430/* Join to solicited addr multicast group. */
@@ -2778,7 +2780,7 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags)
2778 idev->cnf.accept_dad < 1 || 2780 idev->cnf.accept_dad < 1 ||
2779 !(ifp->flags&IFA_F_TENTATIVE) || 2781 !(ifp->flags&IFA_F_TENTATIVE) ||
2780 ifp->flags & IFA_F_NODAD) { 2782 ifp->flags & IFA_F_NODAD) {
2781 ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC); 2783 ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED);
2782 spin_unlock_bh(&ifp->lock); 2784 spin_unlock_bh(&ifp->lock);
2783 read_unlock_bh(&idev->lock); 2785 read_unlock_bh(&idev->lock);
2784 2786
@@ -2795,7 +2797,7 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags)
2795 * - otherwise, kill it. 2797 * - otherwise, kill it.
2796 */ 2798 */
2797 in6_ifa_hold(ifp); 2799 in6_ifa_hold(ifp);
2798 addrconf_dad_stop(ifp); 2800 addrconf_dad_stop(ifp, 0);
2799 return; 2801 return;
2800 } 2802 }
2801 2803
@@ -2829,7 +2831,7 @@ static void addrconf_dad_timer(unsigned long data)
2829 * DAD was successful 2831 * DAD was successful
2830 */ 2832 */
2831 2833
2832 ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC); 2834 ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED);
2833 spin_unlock_bh(&ifp->lock); 2835 spin_unlock_bh(&ifp->lock);
2834 read_unlock_bh(&idev->lock); 2836 read_unlock_bh(&idev->lock);
2835 2837