diff --git a/dhcp6.c b/dhcp6.c index 633925d7..3a7f02c9 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -2473,7 +2473,7 @@ dhcp6_delegate_prefix(struct interface *ifp) ifo = ifp->options; state = D6_STATE(ifp); - /* Try to load configured interfaces for delegation that do not exist */ + /* Ensure we have all interfaces */ for (i = 0; i < ifo->ia_len; i++) { ia = &ifo->ia[i]; for (j = 0; j < ia->sla_len; j++) { @@ -2482,21 +2482,19 @@ dhcp6_delegate_prefix(struct interface *ifp) if (strcmp(sla->ifname, ia->sla[j].ifname) == 0) break; if (j >= i && - if_find(ifp->ctx->ifaces, sla->ifname) == NULL) - { - logger(ifp->ctx, LOG_INFO, - "%s: loading for delegation", sla->ifname); - if (dhcpcd_handleinterface(ifp->ctx, 2, - sla->ifname) == -1) - logger(ifp->ctx, LOG_ERR, - "%s: interface does not exist" - " for delegation", - sla->ifname); - } + ((ifd = if_find(ifp->ctx->ifaces, + sla->ifname)) == NULL || + !ifd->active)) + logger(ifp->ctx, LOG_ERR, + "%s: interface does not exist" + " for delegation", + sla->ifname); } } TAILQ_FOREACH(ifd, ifp->ctx->ifaces, next) { + if (!ifd->active) + continue; k = 0; carrier_warned = abrt = 0; TAILQ_FOREACH(ap, &state->addrs, next) {