summaryrefslogtreecommitdiffstats
path: root/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-03-18 23:03:07 +0000
committerRoy Marples <roy@marples.name>2014-03-18 23:03:07 +0000
commite2c4a256562f40e95aebb8921eca640cc4e2b000 (patch)
treee8173589ad3bcb2cda39b057b1a5d8be3a021c63 /ipv6nd.c
parent9c4606ea55256a43ada0bcf1e6545dd0cd7f71a6 (diff)
downloaddhcpcd-e2c4a256562f40e95aebb8921eca640cc4e2b000.tar.xz
Only fork when the RA has a RDNSS option AND a valid prefix OR no DHCPv6
instruction.
Diffstat (limited to 'ipv6nd.c')
-rw-r--r--ipv6nd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ipv6nd.c b/ipv6nd.c
index a755fe87..d67e88da 100644
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -431,15 +431,17 @@ add_router(struct ipv6_ctx *ctx, struct ra *router)
static int
ipv6nd_scriptrun(struct ra *rap)
{
- int hasdns;
+ int hasdns, hasaddress, pid;
struct ipv6_addr *ap;
const struct ra_opt *rao;
+ hasaddress = 0;
/* If all addresses have completed DAD run the script */
TAILQ_FOREACH(ap, &rap->addrs, next) {
if ((ap->flags & (IPV6_AF_ONLINK | IPV6_AF_AUTOCONF)) ==
(IPV6_AF_ONLINK | IPV6_AF_AUTOCONF))
{
+ hasaddress = 1;
if (!(ap->flags & IPV6_AF_DADCOMPLETED) &&
ipv6_findaddr(ap->iface, &ap->addr))
ap->flags |= IPV6_AF_DADCOMPLETED;
@@ -470,8 +472,10 @@ ipv6nd_scriptrun(struct ra *rap)
}
script_runreason(rap->iface, "ROUTERADVERT");
- if (hasdns)
- hasdns = daemonise(rap->iface->ctx);
+ pid = 0;
+ if (hasdns && (hasaddress ||
+ !(rap->flags & (ND_RA_FLAG_MANAGED | ND_RA_FLAG_OTHER))))
+ pid = daemonise(rap->iface->ctx);
#if 0
else if (options & DHCPCD_DAEMONISE &&
!(options & DHCPCD_DAEMONISED) && new_data)
@@ -481,7 +485,7 @@ ipv6nd_scriptrun(struct ra *rap)
ifp->name);
}
#endif
- return hasdns;
+ return pid;
}
static void