]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Only fork when the RA has a RDNSS option AND a valid prefix OR no DHCPv6
authorRoy Marples <roy@marples.name>
Tue, 18 Mar 2014 23:03:07 +0000 (23:03 +0000)
committerRoy Marples <roy@marples.name>
Tue, 18 Mar 2014 23:03:07 +0000 (23:03 +0000)
instruction.

dhcpcd.conf.5.in
ipv6nd.c

index 6c03c68e73c75bf5b28d41b61007a5495ecb56f4..4ba033aad54eb1b0de25b5c2631643fd79741acc 100644 (file)
@@ -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.
index a755fe879c0d28978484fb986f9e1e86c263a432..d67e88daf47e0f10ca4bb73b7eceb75f0a178c14 100644 (file)
--- 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