summaryrefslogtreecommitdiffstats
path: root/src/privsep-bpf.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-08-20 16:28:47 +0100
committerRoy Marples <roy@marples.name>2020-08-20 16:28:47 +0100
commit2d18b2a25e2e95595ff7b643d2a2754540549e3d (patch)
tree736348035fa69ab8f98a919aedd8185728fcd659 /src/privsep-bpf.c
parent684895a84c40b4484c7e0d7ce555f7154d8e6d22 (diff)
downloaddhcpcd-2d18b2a25e2e95595ff7b643d2a2754540549e3d.tar.xz
privsep: Only the master process accepts signals
The master process dictates when processes should stop, which allows for a clean shutdown when the admin issues `pkill dhcpcd`.
Diffstat (limited to 'src/privsep-bpf.c')
-rw-r--r--src/privsep-bpf.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/privsep-bpf.c b/src/privsep-bpf.c
index 6892bf2a..3025fda8 100644
--- a/src/privsep-bpf.c
+++ b/src/privsep-bpf.c
@@ -40,7 +40,6 @@
#include <assert.h>
#include <pwd.h>
#include <errno.h>
-#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -170,17 +169,6 @@ ps_bpf_start_bpf(void *arg)
return -1;
}
-static void
-ps_bpf_signal_bpfcb(int sig, void *arg)
-{
- struct dhcpcd_ctx *ctx = arg;
-
- if (sig != SIGTERM)
- return;
-
- eloop_exit(ctx->eloop, EXIT_SUCCESS);
-}
-
ssize_t
ps_bpf_cmd(struct dhcpcd_ctx *ctx, struct ps_msghdr *psm, struct msghdr *msg)
{
@@ -249,7 +237,7 @@ ps_bpf_cmd(struct dhcpcd_ctx *ctx, struct ps_msghdr *psm, struct msghdr *msg)
start = ps_dostart(ctx,
&psp->psp_pid, &psp->psp_fd,
ps_bpf_recvmsg, NULL, psp,
- ps_bpf_start_bpf, ps_bpf_signal_bpfcb,
+ ps_bpf_start_bpf, NULL,
PSF_DROPPRIVS);
switch (start) {
case -1: