From a8ae8e7edfc231c7e39fd2444b84e120d8ae15d7 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 1 Sep 2022 20:48:40 +0100 Subject: [PATCH] dhcpcd: Fix sending interface specific commands to manager process Seems to have been broken for a while .... good to have this fixed. --- src/dhcpcd.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 98ce34a4..63da5a18 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -2095,6 +2095,14 @@ printpidfile: snprintf(ctx.pidfile, sizeof(ctx.pidfile), PIDFILE, "", "", ""); ctx.options |= DHCPCD_MANAGER; + + /* + * If we are given any interfaces, we + * cannot send a signal as that would impact + * other interfaces. + */ + if (optind != argc) + sig = 0; } if (ctx.options & DHCPCD_PRINT_PIDFILE) { printf("%s\n", ctx.pidfile); @@ -2130,15 +2138,13 @@ printpidfile: if (pid != 0 && pid != -1) loginfox("sending signal %s to pid %d", siga, pid); if (pid == 0 || pid == -1 || kill(pid, sig) != 0) { - if (sig != SIGHUP && sig != SIGUSR1 && errno != EPERM) - logerrx(PACKAGE" is not running"); if (pid != 0 && pid != -1 && errno != ESRCH) { logerr("kill"); goto exit_failure; } unlink(ctx.pidfile); - if (sig != SIGHUP && sig != SIGUSR1) - goto exit_failure; + /* We can still continue and send the command + * via the control socket. */ } else { struct timespec ts; -- 2.47.2