]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Report all interfaces requested that do not exist.
authorRoy Marples <roy@marples.name>
Fri, 14 Nov 2008 20:38:40 +0000 (20:38 +0000)
committerRoy Marples <roy@marples.name>
Fri, 14 Nov 2008 20:38:40 +0000 (20:38 +0000)
dhcpcd.c

index 06e051af86984b049e7f3c8602b77ece093a58e6..d82c5eb0d4445d9d2cd567048e05cfe7f8828fba 100644 (file)
--- 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)