break;
case 'c':
ARG_REQUIRED;
- if (ifname != NULL) {
+ if (!(ifo->options & DHCPCD_MASTER)) {
logerrx("%s: per interface scripts"
" are no longer supported",
ifname);
ARG_REQUIRED;
/* per interface logging is not supported
* don't want to overide the commandline */
- if (ifname == NULL && ctx->logfile == NULL) {
+ if (ifo->options & DHCPCD_MASTER && ctx->logfile == NULL) {
logclose();
ctx->logfile = strdup(arg);
logopen(ctx->logfile);
break;
case 'z':
ARG_REQUIRED;
- if (ifname == NULL)
+ if (ifo->options & DHCPCD_MASTER)
ctx->ifav = splitv(&ctx->ifac, ctx->ifav, arg);
break;
case 'A':
break;
case 'Z':
ARG_REQUIRED;
- if (ifname == NULL)
+ if (ifo->options & DHCPCD_MASTER)
ctx->ifdv = splitv(&ctx->ifdc, ctx->ifdv, arg);
break;
case '1':
#endif
case O_IAID:
ARG_REQUIRED;
- if (ifname == NULL) {
+ if (ifo->options & DHCPCD_MASTER) {
logerrx("IAID must belong in an interface block");
return -1;
}
logwarnx("%s: IA_PD not compiled in", ifname);
return -1;
#else
- if (ifname == NULL) {
+ if (ifo->options & DHCPCD_MASTER) {
logerrx("IA PD must belong in an "
"interface block");
return -1;
i = D6_OPTION_IA_PD;
#endif
}
- if (ifname == NULL && arg) {
+ if (ifo->options & DHCPCD_MASTER && arg) {
logerrx("IA with IAID must belong in an "
"interface block");
return -1;
ifo->options |= DHCPCD_DHCP6;
#endif
+ /* Set master to indicate global options */
+ ifo->options |= DHCPCD_MASTER;
+
vlen = strlcpy((char *)ifo->vendorclassid + 1, ctx->vendor,
sizeof(ifo->vendorclassid) - 1);
ifo->vendorclassid[0] = (uint8_t)(vlen > 255 ? 0 : vlen);
had_block = 1;
new_block = 0;
ifo->options &= ~DHCPCD_WAITOPTS;
+
+ /* Unset master to indicate non-global options */
+ ifo->options &= ~DHCPCD_MASTER;
}
+
/* Start of an interface block, skip if not ours */
if (strcmp(option, "interface") == 0) {
char **n;