]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
if: don't activate non matching interfaces to commandline ones
authorRoy Marples <roy@marples.name>
Sun, 7 Jan 2018 17:41:27 +0000 (17:41 +0000)
committerRoy Marples <roy@marples.name>
Sun, 7 Jan 2018 17:41:27 +0000 (17:41 +0000)
src/if.c

index 5cdb8e81bdeb273c5e4db787a6e653f86cf57e36..06bb92585a6b5586f5b0bb240356fadfd471b340 100644 (file)
--- 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;