X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=src%2Fra.c;h=e32670ecbba0124b8629d6205df36fb07149ea93;hb=18c1cff36bd3b36b80321282fa7086d8752b63cc;hp=47a2a8d3e5d760ef9652b12ed2d6ca71b5db3229;hpb=f0a2d256fc56bf87cfc7588d018fc7dbcf2503ae;p=odhcp6c.git diff --git a/src/ra.c b/src/ra.c index 47a2a8d..e32670e 100644 --- a/src/ra.c +++ b/src/ra.c @@ -149,15 +149,15 @@ 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)); for (struct rtattr *rta = (struct rtattr*)&ifa[1]; RTA_OK(rta, alen); rta = RTA_NEXT(rta, alen)) - if (rta->rta_type == IFA_LOCAL && RTA_PAYLOAD(rta) >= sizeof(*addr)) + if (rta->rta_type == IFA_ADDRESS && RTA_PAYLOAD(rta) >= sizeof(*addr)) addr = RTA_DATA(rta); if (addr)