Mercurial > hg > dhcpcd
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 5549:6d72dc67a984 | 5550:dba7608e00b3 |
|---|---|
| 132 {"noipv4", no_argument, NULL, O_NOIPV4}, | 132 {"noipv4", no_argument, NULL, O_NOIPV4}, |
| 133 {"ipv6", no_argument, NULL, O_IPV6}, | 133 {"ipv6", no_argument, NULL, O_IPV6}, |
| 134 {"noipv6", no_argument, NULL, O_NOIPV6}, | 134 {"noipv6", no_argument, NULL, O_NOIPV6}, |
| 135 {"noalias", no_argument, NULL, O_NOALIAS}, | 135 {"noalias", no_argument, NULL, O_NOALIAS}, |
| 136 {"iaid", required_argument, NULL, O_IAID}, | 136 {"iaid", required_argument, NULL, O_IAID}, |
| 137 {"ia_na", no_argument, NULL, O_IA_NA}, | 137 {"ia_na", optional_argument, NULL, O_IA_NA}, |
| 138 {"ia_ta", no_argument, NULL, O_IA_TA}, | 138 {"ia_ta", optional_argument, NULL, O_IA_TA}, |
| 139 {"ia_pd", no_argument, NULL, O_IA_PD}, | 139 {"ia_pd", optional_argument, NULL, O_IA_PD}, |
| 140 {"hostname_short", no_argument, NULL, O_HOSTNAME_SHORT}, | 140 {"hostname_short", no_argument, NULL, O_HOSTNAME_SHORT}, |
| 141 {"dev", required_argument, NULL, O_DEV}, | 141 {"dev", required_argument, NULL, O_DEV}, |
| 142 {"nodev", no_argument, NULL, O_NODEV}, | 142 {"nodev", no_argument, NULL, O_NODEV}, |
| 143 {"define", required_argument, NULL, O_DEFINE}, | 143 {"define", required_argument, NULL, O_DEFINE}, |
| 144 {"definend", required_argument, NULL, O_DEFINEND}, | 144 {"definend", required_argument, NULL, O_DEFINEND}, |
| 1342 } | 1342 } |
| 1343 break; | 1343 break; |
| 1344 #endif | 1344 #endif |
| 1345 case O_IAID: | 1345 case O_IAID: |
| 1346 ARG_REQUIRED; | 1346 ARG_REQUIRED; |
| 1347 if (!IN_CONFIG_BLOCK(ifo)) { | 1347 if (ctx->options & DHCPCD_MASTER && !IN_CONFIG_BLOCK(ifo)) { |
| 1348 logerrx("IAID must belong in an interface block"); | 1348 logerrx("IAID must belong in an interface block"); |
| 1349 return -1; | 1349 return -1; |
| 1350 } | 1350 } |
| 1351 if (parse_iaid(ifo->iaid, arg, sizeof(ifo->iaid)) == -1) { | 1351 if (parse_iaid(ifo->iaid, arg, sizeof(ifo->iaid)) == -1) { |
| 1352 logerrx("invalid IAID %s", arg); | 1352 logerrx("invalid IAID %s", arg); |
| 1384 if (i == 0) { | 1384 if (i == 0) { |
| 1385 #ifdef SMALL | 1385 #ifdef SMALL |
| 1386 logwarnx("%s: IA_PD not compiled in", ifname); | 1386 logwarnx("%s: IA_PD not compiled in", ifname); |
| 1387 return -1; | 1387 return -1; |
| 1388 #else | 1388 #else |
| 1389 if (!IN_CONFIG_BLOCK(ifo)) { | 1389 if (ctx->options & DHCPCD_MASTER && |
| 1390 !IN_CONFIG_BLOCK(ifo)) | |
| 1391 { | |
| 1390 logerrx("IA PD must belong in an " | 1392 logerrx("IA PD must belong in an " |
| 1391 "interface block"); | 1393 "interface block"); |
| 1392 return -1; | 1394 return -1; |
| 1393 } | 1395 } |
| 1394 i = D6_OPTION_IA_PD; | 1396 i = D6_OPTION_IA_PD; |
| 1395 #endif | 1397 #endif |
| 1396 } | 1398 } |
| 1397 if (!IN_CONFIG_BLOCK(ifo) && arg) { | 1399 if (ctx->options & DHCPCD_MASTER && |
| 1400 !IN_CONFIG_BLOCK(ifo) && arg) | |
| 1401 { | |
| 1398 logerrx("IA with IAID must belong in an " | 1402 logerrx("IA with IAID must belong in an " |
| 1399 "interface block"); | 1403 "interface block"); |
| 1400 return -1; | 1404 return -1; |
| 1401 } | 1405 } |
| 1402 ifo->options |= DHCPCD_IA_FORCED; | 1406 ifo->options |= DHCPCD_IA_FORCED; |
