init_state(struct interface *ifp, int argc, char **argv)
{
struct if_options *ifo;
- const char *reason;
configure_interface(ifp, argc, argv);
ifo = ifp->options;
syslog(LOG_ERR, "%s: ipv6_start: %m", ifp->name);
ifo->options &= DHCPCD_IPV6;
}
+}
+
+static void
+run_preinit(struct interface *ifp)
+{
+ const char *reason;
reason = NULL; /* appease gcc */
- if (ifo->options & DHCPCD_LINK) {
+ if (ifp->options->options & DHCPCD_LINK) {
switch (if_carrier(ifp)) {
case LINK_DOWN:
ifp->carrier = LINK_DOWN;
}
if (action > 0) {
init_state(ifp, ctx->argc, ctx->argv);
+ run_preinit(ifp);
dhcpcd_startinterface(ifp);
}
}
} else {
TAILQ_INSERT_TAIL(ctx->ifaces, ifp, next);
init_state(ifp, argc, argv);
+ run_preinit(ifp);
dhcpcd_startinterface(ifp);
}
}
}
}
+ TAILQ_FOREACH(ifp, ctx.ifaces, next) {
+ init_state(ifp, argc, argv);
+ }
+
if (ctx.options & DHCPCD_BACKGROUND && dhcpcd_daemonise(&ctx))
goto exit_success;
opt = 0;
TAILQ_FOREACH(ifp, ctx.ifaces, next) {
- init_state(ifp, argc, argv);
+ run_preinit(ifp);
if (ifp->carrier != LINK_DOWN)
opt = 1;
}