]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Now all interfaces are loaded, don't try to load one for delegation.
authorRoy Marples <roy@marples.name>
Thu, 17 Dec 2015 09:22:50 +0000 (09:22 +0000)
committerRoy Marples <roy@marples.name>
Thu, 17 Dec 2015 09:22:50 +0000 (09:22 +0000)
dhcp6.c

diff --git a/dhcp6.c b/dhcp6.c
index 633925d714ccc0959c81f607c2d8e8976569927d..3a7f02c93f0bdfd9a0372c5b38fd438989999d09 100644 (file)
--- 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) {