From: Roy Marples Date: Sun, 7 Jan 2018 17:41:27 +0000 (+0000) Subject: if: don't activate non matching interfaces to commandline ones X-Git-Tag: v7.0.1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bc88b784a89c6295728d752a687abdbbd82dc30;p=thirdparty%2Fdhcpcd.git if: don't activate non matching interfaces to commandline ones --- 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;