Mercurial > hg > dhcpcd
diff src/if-options.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 | 08426e8a98a7 |
| children | 0c4608a6cc2a |
line wrap: on
line diff
--- a/src/if-options.c Tue Nov 24 10:30:08 2020 +0000 +++ b/src/if-options.c Wed Nov 25 14:05:18 2020 +0000 @@ -134,9 +134,9 @@ {"noipv6", no_argument, NULL, O_NOIPV6}, {"noalias", no_argument, NULL, O_NOALIAS}, {"iaid", required_argument, NULL, O_IAID}, - {"ia_na", no_argument, NULL, O_IA_NA}, - {"ia_ta", no_argument, NULL, O_IA_TA}, - {"ia_pd", no_argument, NULL, O_IA_PD}, + {"ia_na", optional_argument, NULL, O_IA_NA}, + {"ia_ta", optional_argument, NULL, O_IA_TA}, + {"ia_pd", optional_argument, NULL, O_IA_PD}, {"hostname_short", no_argument, NULL, O_HOSTNAME_SHORT}, {"dev", required_argument, NULL, O_DEV}, {"nodev", no_argument, NULL, O_NODEV}, @@ -1344,7 +1344,7 @@ #endif case O_IAID: ARG_REQUIRED; - if (!IN_CONFIG_BLOCK(ifo)) { + if (ctx->options & DHCPCD_MASTER && !IN_CONFIG_BLOCK(ifo)) { logerrx("IAID must belong in an interface block"); return -1; } @@ -1386,7 +1386,9 @@ logwarnx("%s: IA_PD not compiled in", ifname); return -1; #else - if (!IN_CONFIG_BLOCK(ifo)) { + if (ctx->options & DHCPCD_MASTER && + !IN_CONFIG_BLOCK(ifo)) + { logerrx("IA PD must belong in an " "interface block"); return -1; @@ -1394,7 +1396,9 @@ i = D6_OPTION_IA_PD; #endif } - if (!IN_CONFIG_BLOCK(ifo) && arg) { + if (ctx->options & DHCPCD_MASTER && + !IN_CONFIG_BLOCK(ifo) && arg) + { logerrx("IA with IAID must belong in an " "interface block"); return -1;
