diff options
| author | Roy Marples <roy@marples.name> | 2013-06-09 07:31:08 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2013-06-09 07:31:08 +0000 |
| commit | d5690e937bb0b6c4f451d3248ee66f4a1460e17c (patch) | |
| tree | 32f3167ae7c8cfbf634087dc01d31a8789e86c9d /ipv6rs.c | |
| parent | af4140cdb403b44edde52aa08139536b689610cb (diff) | |
| download | dhcpcd-d5690e937bb0b6c4f451d3248ee66f4a1460e17c.tar.xz | |
Because not all OS's send RTM_NEWADDR for a refreshed RA we need
to manage a list of all IPv6 addresses on an interface so that we
can know if we need to wait for DAD to complete or not.
Diffstat (limited to 'ipv6rs.c')
| -rw-r--r-- | ipv6rs.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -406,20 +406,25 @@ add_router(struct ra *router) } static void -ipv6rs_scriptrun(const struct ra *rap) +ipv6rs_scriptrun(struct ra *rap) { int hasdns; - const struct ipv6_addr *ap; + struct ipv6_addr *ap; const struct ra_opt *rao; /* If all addresses have completed DAD run the script */ TAILQ_FOREACH(ap, &rap->addrs, next) { - if ((ap->flags & IPV6_AF_DADCOMPLETED) == 0) { - syslog(LOG_DEBUG, - "%s: waiting for Router Advertisement" - " DAD to complete", - rap->iface->name); - return; + if (ap->flags & IPV6_AF_ONLINK) { + if (!(ap->flags & IPV6_AF_DADCOMPLETED) && + ipv6_findaddr(ap->iface, &ap->addr)) + ap->flags |= IPV6_AF_DADCOMPLETED; + if ((ap->flags & IPV6_AF_DADCOMPLETED) == 0) { + syslog(LOG_DEBUG, + "%s: waiting for Router Advertisement" + " DAD to complete", + rap->iface->name); + return; + } } } |
