From: Roy Marples Date: Wed, 18 Mar 2015 08:55:09 +0000 (+0000) Subject: Ensure IPv6 RA/NA and DHCPv6 work on the master interface. X-Git-Tag: v6.8.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6972284887180b090be093a944cd758c610bb825;p=thirdparty%2Fdhcpcd.git Ensure IPv6 RA/NA and DHCPv6 work on the master interface. --- diff --git a/dhcp6.c b/dhcp6.c index 5919b314..b3e3e4b8 100644 --- 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] || diff --git a/ipv6nd.c b/ipv6nd.c index 3850aa37..355a01eb 100644 --- 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; }