Now all interfaces are loaded, don't try to load one for delegation.

This commit is contained in:
Roy Marples 2015-12-17 09:22:50 +00:00
parent df2522249f
commit 0ba37e7e81

22
dhcp6.c
View File

@ -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) {