From 5539a2f25ca0a956710430c316daf2f132675323 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sun, 30 Aug 2020 08:28:44 +0100 Subject: [PATCH] dhcpcd: init new interfaces from route(4) overflow This ensures that any newly active ones have an options structure. --- src/dhcpcd.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dhcpcd.c b/src/dhcpcd.c index e96dcd30..00d6a6f9 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -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); -- 2.47.2