From: Roy Marples Date: Fri, 14 Nov 2008 20:38:40 +0000 (+0000) Subject: Report all interfaces requested that do not exist. X-Git-Tag: v5.0.0~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6be43482df2b919a1c6f15e95d83708c110382d;p=thirdparty%2Fdhcpcd.git Report all interfaces requested that do not exist. --- diff --git a/dhcpcd.c b/dhcpcd.c index 06e051af..d82c5eb0 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -1307,10 +1307,19 @@ main(int argc, char **argv) ifc = argc - optind; ifv = argv + optind; ifaces = discover_interfaces(ifc, ifv); - if (!ifaces && ifc == 1) { - syslog(LOG_ERR, "interface `%s' does not exist", ifv[0]); + for (i = 0; i < ifc; i++) { + for (iface = ifaces; iface; iface = iface->next) + if (strcmp(iface->name, ifv[i]) == 0) + break; + if (!iface) + syslog(LOG_ERR, "%s: invalid interface", ifv[i]); + } + if (!ifaces) { + if (ifc == 0) + syslog(LOG_ERR, "no valid interfaces found"); exit(EXIT_FAILURE); } + if (options & DHCPCD_BACKGROUND) daemonise(); for (iface = ifaces; iface; iface = iface->next)