]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd: init new interfaces from route(4) overflow
authorRoy Marples <roy@marples.name>
Sun, 30 Aug 2020 07:28:44 +0000 (08:28 +0100)
committerRoy Marples <roy@marples.name>
Sun, 30 Aug 2020 07:28:44 +0000 (08:28 +0100)
This ensures that any newly active ones have an options structure.

src/dhcpcd.c

index e96dcd30d2fd3b9daf446d998c475736056ff5d5..00d6a6f90e744f1a564fb3908369b4bf2a1c6d5c 100644 (file)
@@ -1153,6 +1153,16 @@ dhcpcd_setlinkrcvbuf(struct dhcpcd_ctx *ctx)
 }
 #endif
 
+static void
+dhcpcd_initprestartinterface(void *arg)
+{
+       struct interface *ifp = arg;
+
+       dhcpcd_initstate(ifp, 0);
+       run_preinit(ifp);
+       dhcpcd_prestartinterface(ifp);
+}
+
 void
 dhcpcd_linkoverflow(struct dhcpcd_ctx *ctx)
 {
@@ -1217,7 +1227,7 @@ dhcpcd_linkoverflow(struct dhcpcd_ctx *ctx)
                TAILQ_INSERT_TAIL(ctx->ifaces, ifp, next);
                if (ifp->active)
                        eloop_timeout_add_sec(ctx->eloop, 0,
-                           dhcpcd_prestartinterface, ifp);
+                           dhcpcd_initprestartinterface, ifp);
        }
        free(ifaces);