diff options
| author | Roy Marples <roy@marples.name> | 2015-04-30 10:18:45 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2015-04-30 10:18:45 +0000 |
| commit | d23770e2f9519d1b28ac4883dd2d33cfcdcd533b (patch) | |
| tree | 8fd5986cad2a3523306c05385f69277cc5e9ebac /if.c | |
| parent | 68729f15d95543e1e8bb2ee5fc6b432b4a94bb87 (diff) | |
| download | dhcpcd-d23770e2f9519d1b28ac4883dd2d33cfcdcd533b.tar.xz | |
Ensure errno is set if we dont find an interface.
Diffstat (limited to 'if.c')
| -rw-r--r-- | if.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -539,9 +539,10 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv) static struct interface * if_findindexname(struct if_head *ifaces, unsigned int idx, const char *name) { - struct interface *ifp; if (ifaces != NULL) { + struct interface *ifp; + TAILQ_FOREACH(ifp, ifaces, next) { if ((ifp->options == NULL || !(ifp->options->options & DHCPCD_PFXDLGONLY)) && @@ -553,6 +554,8 @@ if_findindexname(struct if_head *ifaces, unsigned int idx, const char *name) return ifp; } } + + errno = ESRCH; return NULL; } |
