}
/* Done with the fd now */
if (pid != 0) {
- syslog(LOG_INFO, "forked to background, child pid %d",pid);
+ syslog(LOG_INFO, "forked to background, child pid %d", pid);
writepid(pidfd, pid);
close(pidfd);
pidfd = -1;
i = EXIT_FAILURE;
exit1:
-
if (ifaces) {
while ((ifp = TAILQ_FIRST(ifaces))) {
TAILQ_REMOVE(ifaces, ifp, next);
TAILQ_INSERT_TAIL(&ipv6_routers, router, next);
}
-static void
+static int
ipv6nd_scriptrun(struct ra *rap)
{
int hasdns;
"%s: waiting for Router Advertisement"
" DAD to complete",
rap->iface->name);
- return;
+ return 0;
}
}
}
script_runreason(rap->iface, "ROUTERADVERT");
if (hasdns)
- daemonise();
+ hasdns = daemonise();
#if 0
else if (options & DHCPCD_DAEMONISE &&
!(options & DHCPCD_DAEMONISED) && new_data)
ifp->name);
}
#endif
+ return hasdns;
}
static void
syslog(LOG_DEBUG,
"%s: Router Advertisement DAD completed",
rap->iface->name);
- ipv6nd_scriptrun(rap);
+ if (ipv6nd_scriptrun(rap))
+ return;
}
}
}
ipv6_buildroutes();
/* We will get run by the expire function */
- if (rap->lifetime)
- ipv6nd_scriptrun(rap);
+ if (rap->lifetime) {
+ if (ipv6nd_scriptrun(rap))
+ return;
+ }
eloop_timeout_delete(NULL, ifp);
eloop_timeout_delete(NULL, rap); /* reachable timer */