diff options
| author | Roy Marples <roy@marples.name> | 2018-01-07 17:41:27 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2018-01-07 17:41:27 +0000 |
| commit | 6cd6c1cba4877aab3e570afc78554b0730ebaaf9 (patch) | |
| tree | 79881d05b1aaa41653b062157083692427e73404 /src/if.c | |
| parent | c6ae2f2e5d0b9b35771ac5a5290502fd28f93999 (diff) | |
| download | dhcpcd-6cd6c1cba4877aab3e570afc78554b0730ebaaf9.tar.xz | |
if: don't activate non matching interfaces to commandline ones
Diffstat (limited to 'src/if.c')
| -rw-r--r-- | src/if.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; |
