diff src/dhcpcd.c @ 5550:dba7608e00b3 draft

options: allow --ia_na=1 and --ia_pd=2 on the command line This only works for non master mode.
author Roy Marples <roy@marples.name>
date Wed, 25 Nov 2020 14:05:18 +0000
parents c9182c3618e6
children 0c4608a6cc2a
line wrap: on
line diff
--- a/src/dhcpcd.c	Tue Nov 24 10:30:08 2020 +0000
+++ b/src/dhcpcd.c	Wed Nov 25 14:05:18 2020 +0000
@@ -1883,6 +1883,7 @@
 		logopts |= LOGERR_ERR;
 
 	i = 0;
+
 	while ((opt = getopt_long(argc, argv,
 	    ctx.options & DHCPCD_PRINT_PIDFILE ? NOERR_IF_OPTS : IF_OPTS,
 	    cf_options, &oi)) != -1)
@@ -1957,6 +1958,9 @@
 		}
 	}
 
+	if (optind != argc - 1)
+		ctx.options |= DHCPCD_MASTER;
+
 	logsetopts(logopts);
 	logopen(ctx.logfile);
 
@@ -1973,6 +1977,7 @@
 			goto printpidfile;
 		goto exit_failure;
 	}
+
 	opt = add_options(&ctx, NULL, ifo, argc, argv);
 	if (opt != 1) {
 		if (ctx.options & DHCPCD_PRINT_PIDFILE)
@@ -2013,6 +2018,7 @@
 		goto exit_success;
 	}
 	ctx.options |= ifo->options;
+
 	if (i == 1 || i == 3) {
 		if (i == 1)
 			ctx.options |= DHCPCD_TEST;