summaryrefslogtreecommitdiffstats
path: root/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-07-27 16:47:34 +0000
committerRoy Marples <roy@marples.name>2016-07-27 16:47:34 +0000
commitb4a8658466fc01fcb075e765c9d5e568e5665412 (patch)
treeed4524f71c0e34e6d95aa460e207635ded2ad283 /if.c
parentd2a12089d3f8d9a9f685ea30226f4aef304c87cb (diff)
downloaddhcpcd-b4a8658466fc01fcb075e765c9d5e568e5665412.tar.xz
Add --inactive which makes all interfaces inactive on initial start.
Subsequent dhcpcd commands will start each interface.
Diffstat (limited to 'if.c')
-rw-r--r--if.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/if.c b/if.c
index dad80ca2..b79f01b1 100644
--- a/if.c
+++ b/if.c
@@ -291,20 +291,20 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv)
if (ifp)
continue;
- active = IF_ACTIVE_USER;
if (argc > 0) {
for (i = 0; i < argc; i++) {
if (strcmp(argv[i], spec.devname) == 0)
break;
}
- if (i == argc)
- active = IF_INACTIVE;
+ active = (i == argc) ? IF_INACTIVE : IF_ACTIVE_USER;
} else {
/* -1 means we're discovering against a specific
* interface, but we still need the below rules
* to apply. */
if (argc == -1 && strcmp(argv[0], spec.devname) != 0)
continue;
+ active = ctx->options & DHCPCD_INACTIVE ?
+ IF_INACTIVE: IF_ACTIVE_USER;
}
for (i = 0; i < ctx->ifdc; i++)