summaryrefslogtreecommitdiffstats
path: root/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2015-04-30 10:16:06 +0000
committerRoy Marples <roy@marples.name>2015-04-30 10:16:06 +0000
commit68729f15d95543e1e8bb2ee5fc6b432b4a94bb87 (patch)
tree29b44138a1efee76ebee139ff33328aa9f3c5ea6 /if.c
parentd0038a71ccc51d3add40c92702f3bee4ecb2bb29 (diff)
downloaddhcpcd-68729f15d95543e1e8bb2ee5fc6b432b4a94bb87.tar.xz
Make finding interfaces take an interface list rather than a dhcpcd_ctx.
Diffstat (limited to 'if.c')
-rw-r--r--if.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/if.c b/if.c
index 240f7fd2..b89a5cd9 100644
--- a/if.c
+++ b/if.c
@@ -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