summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-12-10 21:00:58 +0000
committerRoy Marples <roy@marples.name>2019-12-10 21:00:58 +0000
commit3ac9885e95854fd82dc498fbc3871a04b5ed1c69 (patch)
treec5ea716fb398af9892c779107328c5f4b7ea5a24 /src/dhcpcd.c
parente02016b276ef1dbd02f02ba0b1c9a0e71639f28b (diff)
downloaddhcpcd-3ac9885e95854fd82dc498fbc3871a04b5ed1c69.tar.xz
privsep: Enable ARP BPF filtering for interesting addresses
This brings parity with non privsep features. Aside from the lack of Solaris support, but that's another day.
Diffstat (limited to 'src/dhcpcd.c')
-rw-r--r--src/dhcpcd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index fefe3c94..6a3b86f5 100644
--- a/src/dhcpcd.c
+++ b/src/dhcpcd.c
@@ -1538,14 +1538,18 @@ static void
dhcpcd_fork_cb(void *arg)
{
struct dhcpcd_ctx *ctx = arg;
- int exit_code = EXIT_FAILURE;
+ int exit_code;
ssize_t len;
len = read(ctx->fork_fd, &exit_code, sizeof(exit_code));
- if (len == -1)
+ if (len == -1) {
logerr(__func__);
- else if ((size_t)len < sizeof(exit_code))
- logerr("%s: truncated read", __func__);
+ exit_code = EXIT_FAILURE;
+ } else if ((size_t)len < sizeof(exit_code)) {
+ logerrx("%s: truncated read %zd (expected %zu)",
+ __func__, len, sizeof(exit_code));
+ exit_code = EXIT_FAILURE;
+ }
eloop_exit(ctx->eloop, exit_code);
}