summaryrefslogtreecommitdiffstats
path: root/ipv6rs.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2013-06-09 07:31:08 +0000
committerRoy Marples <roy@marples.name>2013-06-09 07:31:08 +0000
commitd5690e937bb0b6c4f451d3248ee66f4a1460e17c (patch)
tree32f3167ae7c8cfbf634087dc01d31a8789e86c9d /ipv6rs.c
parentaf4140cdb403b44edde52aa08139536b689610cb (diff)
downloaddhcpcd-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.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/ipv6rs.c b/ipv6rs.c
index 3130297f..5652cd47 100644
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -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;
+ }
}
}