From: Roy Marples Date: Fri, 13 Dec 2013 09:35:35 +0000 (+0000) Subject: Fix multiple arping options X-Git-Tag: v6.2.0~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48ac077b207bd9d3a0776d6bbff5df228f9ce945;p=thirdparty%2Fdhcpcd.git Fix multiple arping options --- diff --git a/if-options.c b/if-options.c index aac0ff40..9dd065e8 100644 --- a/if-options.c +++ b/if-options.c @@ -1039,16 +1039,25 @@ parse_option(struct if_options *ifo, int opt, const char *arg) break; #ifdef INET case O_ARPING: - if (parse_addr(&addr, NULL, arg) != 0) - return -1; - naddr = realloc(ifo->arping, - sizeof(in_addr_t) * (ifo->arping_len + 1)); - if (naddr == NULL) { - syslog(LOG_ERR, "%s: %m", __func__); - return -1; + while (arg && *arg != '\0') { + fp = strwhite(arg); + if (fp) + *fp++ = '\0'; + if (parse_addr(&addr, NULL, arg) != 0) + return -1; + naddr = realloc(ifo->arping, + sizeof(in_addr_t) * (ifo->arping_len + 1)); + if (naddr == NULL) { + syslog(LOG_ERR, "%s: %m", __func__); + return -1; + } + ifo->arping = naddr; + ifo->arping[ifo->arping_len++] = addr.s_addr; + if (fp) + arg = strskipwhite(fp); + else + arg = NULL; } - ifo->arping = naddr; - ifo->arping[ifo->arping_len++] = addr.s_addr; break; case O_DESTINATION: if (make_option_mask(dhcp_opts, dhcp_opts_len,