From: Roy Marples Date: Thu, 1 Sep 2022 19:48:40 +0000 (+0100) Subject: dhcpcd: Fix sending interface specific commands to manager process X-Git-Tag: v10.0.0~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86532445db25f41427f5135b03e6955fb705e879;p=thirdparty%2Fdhcpcd.git dhcpcd: Fix sending interface specific commands to manager process Seems to have been broken for a while .... good to have this fixed. --- diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 7a59d758..23a7f0a3 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -2119,6 +2119,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); @@ -2154,15 +2162,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;