]> git.decadent.org.uk Git - odhcp6c.git/commitdiff
Detect more DADFAILED cases
authorSteven Barth <steven@midlink.org>
Fri, 1 Feb 2013 11:05:33 +0000 (12:05 +0100)
committerSteven Barth <steven@midlink.org>
Fri, 1 Feb 2013 11:05:33 +0000 (12:05 +0100)
src/ra.c

index 47a2a8d3e5d760ef9652b12ed2d6ca71b5db3229..f1a5f7fdb5747d0160283adff8a2dc9c43db12b1 100644 (file)
--- a/src/ra.c
+++ b/src/ra.c
@@ -149,9 +149,9 @@ bool ra_rtnl_process(void)
                                        nh = NLMSG_NEXT(nh, len)) {
                        struct ifaddrmsg *ifa = NLMSG_DATA(nh);
                        struct in6_addr *addr = NULL;
-                       if (nh->nlmsg_type != RTM_NEWADDR || NLMSG_PAYLOAD(nh, 0) < sizeof(*ifa) ||
-                                       !(ifa->ifa_flags & IFA_F_DADFAILED) ||
-                                       ifa->ifa_index != if_index)
+                       if (NLMSG_PAYLOAD(nh, 0) < sizeof(*ifa) || ifa->ifa_index != if_index ||
+                                       (nh->nlmsg_type == RTM_NEWADDR && !(ifa->ifa_flags & IFA_F_DADFAILED)) ||
+                                       (nh->nlmsg_type == RTM_DELADDR && !(ifa->ifa_flags & IFA_F_TENTATIVE)))
                                continue;
 
                        ssize_t alen = NLMSG_PAYLOAD(nh, sizeof(*ifa));