diff options
| author | Roy Marples <roy@marples.name> | 2008-08-14 16:15:45 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-08-14 16:15:45 +0000 |
| commit | fb8a5f981735c7c6a85a9f996cc4bcd39f48e34a (patch) | |
| tree | b05b59b98d2946f2bf989747e6c792e67cc57edf /net.c | |
| parent | 50b9957e82beba942dffd8574fe937597ddb1fe6 (diff) | |
| download | dhcpcd-fb8a5f981735c7c6a85a9f996cc4bcd39f48e34a.tar.xz | |
If a device is not found, report it.
Diffstat (limited to 'net.c')
| -rw-r--r-- | net.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -183,7 +183,7 @@ do_interface(const char *ifname, { int s; struct ifconf ifc; - int retval = 0; + int retval = 0, found = 0; int len = 10 * sizeof(struct ifreq); int lastlen = 0; char *p; @@ -240,6 +240,8 @@ do_interface(const char *ifname, if (strcmp(ifname, ifr->ifr_name) != 0) continue; + found = 1; + #ifdef AF_LINK if (hwaddr && hwlen && ifr->ifr_addr.sa_family == AF_LINK) { sdl = xmalloc(ifr->ifr_addr.sa_len); @@ -275,6 +277,8 @@ do_interface(const char *ifname, } + if (!found) + errno = ENXIO; close(s); free(ifc.ifc_buf); return retval; |
