From: Roy Marples Date: Tue, 11 Mar 2014 10:41:27 +0000 (+0000) Subject: Ensure that -M -x ifname does the right thing. X-Git-Tag: v6.3.2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f970fb668ee571dc04b66d5ad77696a9a750dd77;p=thirdparty%2Fdhcpcd.git Ensure that -M -x ifname does the right thing. --- diff --git a/dhcpcd.c b/dhcpcd.c index 2e3f2caf..8ccb8910 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -1196,6 +1196,9 @@ main(int argc, char **argv) ctx.argv = argv; ctx.argc = argc; + ctx.ifc = argc - optind; + ctx.ifv = argv + optind; + ifo = read_config(&ctx, NULL, NULL, NULL); opt = add_options(&ctx, NULL, ifo, argc, argv); if (opt != 1) { @@ -1278,7 +1281,9 @@ main(int argc, char **argv) } #ifdef USE_SIGNALS - if (!(ctx.options & (DHCPCD_MASTER | DHCPCD_TEST))) { + if (!(ctx.options & DHCPCD_TEST) && + (sig == 0 || ctx.ifc != 0)) + { #endif if (ctx.options & DHCPCD_MASTER) i = -1; @@ -1412,9 +1417,6 @@ main(int argc, char **argv) syslog(LOG_WARNING, "IPv4 subnet routes cannot be deleted"); #endif - ctx.ifc = argc - optind; - ctx.ifv = argv + optind; - /* When running dhcpcd against a single interface, we need to retain * the old behaviour of waiting for an IP address */ if (ctx.ifc == 1 && !(ctx.options & DHCPCD_BACKGROUND))