changeset 5427:f6d641a87e0a draft

dhcpcd: init new interfaces from route(4) overflow This ensures that any newly active ones have an options structure.
author Roy Marples <roy@marples.name>
date Sun, 30 Aug 2020 08:28:44 +0100
parents edcbeacf2225
children ab53e42710ae
files src/dhcpcd.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dhcpcd.c	Sun Aug 30 08:03:01 2020 +0100
+++ b/src/dhcpcd.c	Sun Aug 30 08:28:44 2020 +0100
@@ -1153,6 +1153,16 @@
 }
 #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 @@
 		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);