for (ifn = ifs; ifn; ifn = ifn->next)
if (strcmp(ifn->name, ifp->name) == 0)
break;
- if (ifn == NULL)
+ if (ifn == NULL) {
+ ifl = ifp->next;
stop_interface(ifp);
+ }
}
}
struct interface *ifp, *ifl;
struct if_options *ifo;
int sig = signal_read();
- int do_release, do_rebind;
+ int do_release, do_rebind, i;
do_rebind = do_release = 0;
switch (sig) {
break;
case SIGALRM:
syslog(LOG_INFO, "received SIGALRM, rebinding");
+ for (i = 0; i < ifac; i++)
+ free(ifav[i]);
+ free(ifav);
+ ifav = NULL;
+ ifac = 0;
+ for (i = 0; i < ifdc; i++)
+ free(ifdv[i]);
+ free(ifdv);
+ ifdc = 0;
+ ifdv = NULL;
ifo = read_config(cffile, NULL, NULL, NULL);
+ add_options(ifo, margc, margv);
/* We need to preserve these two options. */
if (options & DHCPCD_MASTER)
ifo->options |= DHCPCD_MASTER;
}
break;
case 'z':
- /* We only set this if we haven't got any interfaces */
- if (!ifaces)
- ifav = splitv(&ifac, ifav, arg);
+ ifav = splitv(&ifac, ifav, arg);
break;
case 'A':
ifo->options &= ~DHCPCD_ARP;
ifo->blacklist[ifo->blacklist_len++] = addr2.s_addr;
break;
case 'Z':
- /* We only set this if we haven't got any interfaces */
- if (!ifaces)
- ifdv = splitv(&ifdc, ifdv, arg);
+ ifdv = splitv(&ifdc, ifdv, arg);
break;
case O_ARPING:
if (parse_addr(&addr, NULL, arg) != 0)
}
if (skip)
continue;
- if (parse_config_line(ifo, option, line) != 1)
- break;
+ parse_config_line(ifo, option, line);
}
fclose(f);