summaryrefslogtreecommitdiffstats
path: root/src/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2018-01-07 17:41:27 +0000
committerRoy Marples <roy@marples.name>2018-01-07 17:41:27 +0000
commit6cd6c1cba4877aab3e570afc78554b0730ebaaf9 (patch)
tree79881d05b1aaa41653b062157083692427e73404 /src/if.c
parentc6ae2f2e5d0b9b35771ac5a5290502fd28f93999 (diff)
downloaddhcpcd-6cd6c1cba4877aab3e570afc78554b0730ebaaf9.tar.xz
if: don't activate non matching interfaces to commandline ones
Diffstat (limited to 'src/if.c')
-rw-r--r--src/if.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/if.c b/src/if.c
index 5cdb8e81..06bb9258 100644
--- a/src/if.c
+++ b/src/if.c
@@ -361,12 +361,17 @@ if_discover(struct dhcpcd_ctx *ctx, struct ifaddrs **ifaddrs,
}
for (i = 0; i < ctx->ifdc; i++)
- if (!fnmatch(ctx->ifdv[i], spec.devname, 0))
+ if (fnmatch(ctx->ifdv[i], spec.devname, 0) == 0)
break;
if (i < ctx->ifdc)
active = IF_INACTIVE;
+ for (i = 0; i < ctx->ifc; i++)
+ if (fnmatch(ctx->ifv[i], spec.devname, 0) == 0)
+ break;
+ if (ctx->ifc && i == ctx->ifc)
+ active = IF_INACTIVE;
for (i = 0; i < ctx->ifac; i++)
- if (!fnmatch(ctx->ifav[i], spec.devname, 0))
+ if (fnmatch(ctx->ifav[i], spec.devname, 0) == 0)
break;
if (ctx->ifac && i == ctx->ifac)
active = IF_INACTIVE;