int dev_listening(struct dhcpcd_ctx *);
int dev_start(struct dhcpcd_ctx *, int (*)(void *, int, const char *));
void dev_stop(struct dhcpcd_ctx *);
-#else
-#define dev_initialized(a, b) (1)
-#define dev_listening(a) (0)
-#define dev_start(a) {}
-#define dev_stop(a) {}
#endif
#endif
goto exit_failure;
}
+#ifdef PLUGIN_DEV
/* Start any dev listening plugin which may want to
* change the interface name provided by the kernel */
if (!IN_PRIVSEP(&ctx) &&
(ctx.options & (DHCPCD_MASTER | DHCPCD_DEV)) ==
(DHCPCD_MASTER | DHCPCD_DEV))
dev_start(&ctx, dhcpcd_handleinterface);
+#endif
setproctitle("%s%s%s",
ctx.options & DHCPCD_MASTER ? "[master]" : argv[optind],
#ifdef INET6
ipv6_ctxfree(&ctx);
#endif
+#ifdef PLUGIN_DEV
dev_stop(&ctx);
+#endif
#ifdef PRIVSEP
eloop_free(ctx.ps_eloop);
#endif
logerr(__func__);
}
+#ifdef PLUGIN_DEV
static int
ps_root_handleinterface(void *arg, int action, const char *ifname)
{
return (int)ps_sendcmd(ctx, ctx->ps_data_fd, PS_DEV_IFCMD, flag,
ifname, strlen(ifname) + 1);
}
+#endif
static int
ps_root_startcb(void *arg)
return -1;
#endif
+#ifdef PLUGIN_DEV
/* Start any dev listening plugin which may want to
* change the interface name provided by the kernel */
if ((ctx->options & (DHCPCD_MASTER | DHCPCD_DEV)) ==
(DHCPCD_MASTER | DHCPCD_DEV))
dev_start(ctx, ps_root_handleinterface);
+#endif
return 0;
}
logdebugx("process %d stopping", getpid());
#endif
ps_free(ctx);
+#ifdef PLUGIN_DEV
dev_stop(ctx);
+#endif
eloop_exit(ctx->eloop, len != -1 ? EXIT_SUCCESS : EXIT_FAILURE);
return len;
}