summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-03-11 10:41:27 +0000
committerRoy Marples <roy@marples.name>2014-03-11 10:41:27 +0000
commitf970fb668ee571dc04b66d5ad77696a9a750dd77 (patch)
tree9898ebfc17a02a61f66328c1349a955bb3d2c361 /dhcpcd.c
parent1ef693d0cab55c50abfa012520282f36816ac055 (diff)
downloaddhcpcd-f970fb668ee571dc04b66d5ad77696a9a750dd77.tar.xz
Ensure that -M -x ifname does the right thing.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c10
1 files changed, 6 insertions, 4 deletions
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))