summaryrefslogtreecommitdiffstats
path: root/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-09-04 19:55:37 +0000
committerRoy Marples <roy@marples.name>2014-09-04 19:55:37 +0000
commita0011b993364c6ac24e4e5e534ac07fcef2d02c3 (patch)
tree881d45c4552b1265042d1c7a233ecbb4a0828772 /ipv6nd.c
parent6f4828849f0f25ad9d651008c00170a2990be8ec (diff)
downloaddhcpcd-a0011b993364c6ac24e4e5e534ac07fcef2d02c3.tar.xz
Only send DHCPv6 and RA to control sockets when DAD has been completed.
Diffstat (limited to 'ipv6nd.c')
-rw-r--r--ipv6nd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/ipv6nd.c b/ipv6nd.c
index 9a63de18..d62f1615 100644
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -580,6 +580,24 @@ ipv6nd_addaddr(void *arg)
ipv6_addaddr(ap);
}
+int
+ipv6nd_dadcompleted(const struct interface *ifp)
+{
+ const struct ra *rap;
+ const struct ipv6_addr *ap;
+
+ TAILQ_FOREACH(rap, ifp->ctx->ipv6->ra_routers, next) {
+ if (rap->iface != ifp)
+ continue;
+ TAILQ_FOREACH(ap, &rap->addrs, next) {
+ if (ap->flags & IPV6_AF_AUTOCONF &&
+ !(ap->flags & IPV6_AF_DADCOMPLETED))
+ return 0;
+ }
+ }
+ return 1;
+}
+
static void
ipv6nd_dadcallback(void *arg)
{