summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-11-14 20:38:40 +0000
committerRoy Marples <roy@marples.name>2008-11-14 20:38:40 +0000
commite6be43482df2b919a1c6f15e95d83708c110382d (patch)
tree6f2a947b452c20ba68a852ac459e8fe0d268b14b /dhcpcd.c
parent4ad77cd73759b823ca56cfaac5e34b60394aa4f6 (diff)
downloaddhcpcd-e6be43482df2b919a1c6f15e95d83708c110382d.tar.xz
Report all interfaces requested that do not exist.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c13
1 files changed, 11 insertions, 2 deletions
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)