diff options
| author | Roy Marples <roy@marples.name> | 2015-04-30 10:16:06 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2015-04-30 10:16:06 +0000 |
| commit | 68729f15d95543e1e8bb2ee5fc6b432b4a94bb87 (patch) | |
| tree | 29b44138a1efee76ebee139ff33328aa9f3c5ea6 /if.c | |
| parent | d0038a71ccc51d3add40c92702f3bee4ecb2bb29 (diff) | |
| download | dhcpcd-68729f15d95543e1e8bb2ee5fc6b432b4a94bb87.tar.xz | |
Make finding interfaces take an interface list rather than a dhcpcd_ctx.
Diffstat (limited to 'if.c')
| -rw-r--r-- | if.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -537,12 +537,12 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv) } static struct interface * -if_findindexname(struct dhcpcd_ctx *ctx, unsigned int idx, const char *name) +if_findindexname(struct if_head *ifaces, unsigned int idx, const char *name) { struct interface *ifp; - if (ctx != NULL && ctx->ifaces != NULL) { - TAILQ_FOREACH(ifp, ctx->ifaces, next) { + if (ifaces != NULL) { + TAILQ_FOREACH(ifp, ifaces, next) { if ((ifp->options == NULL || !(ifp->options->options & DHCPCD_PFXDLGONLY)) && ((name && strcmp(ifp->name, name) == 0) || @@ -557,17 +557,17 @@ if_findindexname(struct dhcpcd_ctx *ctx, unsigned int idx, const char *name) } struct interface * -if_find(struct dhcpcd_ctx *ctx, const char *name) +if_find(struct if_head *ifaces, const char *name) { - return if_findindexname(ctx, 0, name); + return if_findindexname(ifaces, 0, name); } struct interface * -if_findindex(struct dhcpcd_ctx *ctx, unsigned int idx) +if_findindex(struct if_head *ifaces, unsigned int idx) { - return if_findindexname(ctx, idx, NULL); + return if_findindexname(ifaces, idx, NULL); } int |
