ipv6: Send netlink notification when DAD fails
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 13 Mar 2010 20:23:29 +0000 (12:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Mar 2010 20:23:29 +0000 (12:23 -0800)
If we are managing IPv6 addresses using DHCP, it would be nice
for user-space to be notified if an address configured through
DHCP fails DAD.  Otherwise user-space would have to poll to see
whether DAD succeeds.

This patch uses the existing notification mechanism and simply
hooks it into the DAD failure code path.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c

index 6cf3ee14ace3c8919f56f30ae0873cc12b03524a..3381b4317c270230a7c44ee7d57daf6ac4345897 100644 (file)
@@ -1380,6 +1380,8 @@ static void addrconf_dad_stop(struct inet6_ifaddr *ifp, int dad_failed)
                if (dad_failed)
                        ifp->flags |= IFA_F_DADFAILED;
                spin_unlock_bh(&ifp->lock);
+               if (dad_failed)
+                       ipv6_ifa_notify(0, ifp);
                in6_ifa_put(ifp);
 #ifdef CONFIG_IPV6_PRIVACY
        } else if (ifp->flags&IFA_F_TEMPORARY) {