summaryrefslogtreecommitdiffstats
path: root/src/privsep.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-10-07 15:28:33 +0100
committerRoy Marples <roy@marples.name>2020-10-07 15:28:33 +0100
commit5699c07d535fbe8cdc513b1c380519cb861009b3 (patch)
tree51497bd058038663df30e92e4e9d22cdb0cda420 /src/privsep.c
parentd047f2dd0d9cee881d1d3e56da8ba67664f7726d (diff)
downloaddhcpcd-5699c07d535fbe8cdc513b1c380519cb861009b3.tar.xz
privsep: Only start network proxy if we need to
Do this before starting it rather than it shutting down.
Diffstat (limited to 'src/privsep.c')
-rw-r--r--src/privsep.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/privsep.c b/src/privsep.c
index 771e7317..aa87cd0c 100644
--- a/src/privsep.c
+++ b/src/privsep.c
@@ -467,13 +467,11 @@ ps_start(struct dhcpcd_ctx *ctx)
/* No point in spawning the generic network listener if we're
* not going to use it. */
- if (!(ctx->options & (DHCPCD_MASTER | DHCPCD_IPV6)))
+ if (!ps_inet_canstart(ctx))
goto started_net;
switch (pid = ps_inet_start(ctx)) {
case -1:
- if (errno == ENXIO)
- return 0;
return -1;
case 0:
return 0;