diff options
| author | Roy Marples <roy@marples.name> | 2008-11-14 20:38:40 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-11-14 20:38:40 +0000 |
| commit | e6be43482df2b919a1c6f15e95d83708c110382d (patch) | |
| tree | 6f2a947b452c20ba68a852ac459e8fe0d268b14b /dhcpcd.c | |
| parent | 4ad77cd73759b823ca56cfaac5e34b60394aa4f6 (diff) | |
| download | dhcpcd-e6be43482df2b919a1c6f15e95d83708c110382d.tar.xz | |
Report all interfaces requested that do not exist.
Diffstat (limited to 'dhcpcd.c')
| -rw-r--r-- | dhcpcd.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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) |
