]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Ensure IPv6 RA/NA and DHCPv6 work on the master interface.
authorRoy Marples <roy@marples.name>
Wed, 18 Mar 2015 08:55:09 +0000 (08:55 +0000)
committerRoy Marples <roy@marples.name>
Wed, 18 Mar 2015 08:55:09 +0000 (08:55 +0000)
dhcp6.c
ipv6nd.c

diff --git a/dhcp6.c b/dhcp6.c
index 5919b314ca23fb893cb6bed4f1439d3f944bee86..b3e3e4b8efa88031d0ef4a3ae34cc1da8f3ed8e9 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -2627,7 +2627,6 @@ dhcp6_handledata(void *arg)
                        break;
                }
        }
-
        if (pkt.ipi6_ifindex == 0) {
                logger(dctx, LOG_ERR,
                    "DHCPv6 reply did not contain index from %s", ctx->sfrom);
@@ -2635,7 +2634,9 @@ dhcp6_handledata(void *arg)
        }
 
        TAILQ_FOREACH(ifp, dctx->ifaces, next) {
-               if (ifp->index == (unsigned int)pkt.ipi6_ifindex)
+               /* Ensure we work on the master interface */
+               if (ifp->index == (unsigned int)pkt.ipi6_ifindex &&
+                   !(ifp->options->options & DHCPCD_PFXDLGONLY))
                        break;
        }
        if (ifp == NULL) {
@@ -2663,11 +2664,16 @@ dhcp6_handledata(void *arg)
                    "%s: DHCPv6 reply received but not running", ifp->name);
                return;
        }
+
        /* We're already bound and this message is for another machine */
        /* XXX DELEGATED? */
        if (r->type != DHCP6_RECONFIGURE &&
-           (state->state == DH6S_BOUND || state->state == DH6S_INFORMED))
+           (state->state == DH6S_BOUND || state->state == DH6S_INFORMED)) 
+       {
+               logger(ifp->ctx, LOG_DEBUG,
+                   "%s: DHCPv6 reply received but already bound", ifp->name);
                return;
+       }
 
        if (r->type != DHCP6_RECONFIGURE &&
            (r->xid[0] != state->send->xid[0] ||
index 3850aa375ac7d937c40e588ca4c3a73f8c1cf725..355a01ebe76d982db96777d60f07df3bb835c2f8 100644 (file)
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -1586,9 +1586,10 @@ ipv6nd_handledata(void *arg)
        }
 
        TAILQ_FOREACH(ifp, dctx->ifaces, next) {
-               if (ifp->index == (unsigned int)pkt.ipi6_ifindex) {
-                       if (!(ifp->options->options & DHCPCD_IPV6) ||
-                           ifp->options->options & DHCPCD_PFXDLGONLY)
+               if (ifp->index == (unsigned int)pkt.ipi6_ifindex &&
+                   !(ifp->options->options & DHCPCD_PFXDLGONLY))
+               {
+                       if (!(ifp->options->options & DHCPCD_IPV6))
                                return;
                        break;
                }