From: Roy Marples Date: Tue, 18 Mar 2014 23:03:07 +0000 (+0000) Subject: Only fork when the RA has a RDNSS option AND a valid prefix OR no DHCPv6 X-Git-Tag: v6.4.0~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2c4a256562f40e95aebb8921eca640cc4e2b000;p=thirdparty%2Fdhcpcd.git Only fork when the RA has a RDNSS option AND a valid prefix OR no DHCPv6 instruction. --- diff --git a/dhcpcd.conf.5.in b/dhcpcd.conf.5.in index 6c03c68e..4ba033aa 100644 --- a/dhcpcd.conf.5.in +++ b/dhcpcd.conf.5.in @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 30, 2014 +.Dd March 18, 2014 .Dt DHCPCD.CONF 5 .Os .Sh NAME @@ -284,7 +284,7 @@ By default, when receives an IPv6 RA, .Nm dhcpcd will only fork to the background if the RA contains at least one unexpired -RDNSS option. +RDNSS option and a valid prefix or no DHCPv6 instruction. Set this option so to make .Nm dhcpcd always fork on an RA. 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