# HG changeset patch # User Roy Marples # Date 1590317398 -3600 # Node ID f168a25dd330bf6cf15cdb427e34babadba8b69f # Parent 33324d44a2e80d8747f697a97feaf53109ddaa4b privsep: Fix compile for prior without dev plugins diff -r 33324d44a2e8 -r f168a25dd330 src/dev.h --- a/src/dev.h Sun May 24 10:36:14 2020 +0000 +++ b/src/dev.h Sun May 24 11:49:58 2020 +0100 @@ -51,11 +51,6 @@ 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 diff -r 33324d44a2e8 -r f168a25dd330 src/dhcpcd.c --- a/src/dhcpcd.c Sun May 24 10:36:14 2020 +0000 +++ b/src/dhcpcd.c Sun May 24 11:49:58 2020 +0100 @@ -2256,12 +2256,14 @@ 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], @@ -2454,7 +2456,9 @@ #ifdef INET6 ipv6_ctxfree(&ctx); #endif +#ifdef PLUGIN_DEV dev_stop(&ctx); +#endif #ifdef PRIVSEP eloop_free(ctx.ps_eloop); #endif diff -r 33324d44a2e8 -r f168a25dd330 src/privsep-root.c --- a/src/privsep-root.c Sun May 24 10:36:14 2020 +0000 +++ b/src/privsep-root.c Sun May 24 11:49:58 2020 +0100 @@ -556,6 +556,7 @@ logerr(__func__); } +#ifdef PLUGIN_DEV static int ps_root_handleinterface(void *arg, int action, const char *ifname) { @@ -576,6 +577,7 @@ 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) @@ -612,11 +614,13 @@ 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; } diff -r 33324d44a2e8 -r f168a25dd330 src/privsep.c --- a/src/privsep.c Sun May 24 10:36:14 2020 +0000 +++ b/src/privsep.c Sun May 24 11:49:58 2020 +0100 @@ -697,7 +697,9 @@ 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; }