]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix discovery
authorRoy Marples <roy@marples.name>
Tue, 16 Sep 2008 10:02:14 +0000 (10:02 +0000)
committerRoy Marples <roy@marples.name>
Tue, 16 Sep 2008 10:02:14 +0000 (10:02 +0000)
if-bsd.c

index ef5c1f2d3759c9356a0274f29cd1a0c000202b52..02f3814dae9e088f8336af04d6996b08a1ab85cc 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -310,7 +310,9 @@ discover_link(struct interface **ifs, int argc, char * const *argv,
        if (argc > 0) {
                for (n = 0; n < argc; n++)
                        if (strcmp(ifr->ifr_name, argv[n]) == 0)
-                               return;
+                               break;
+               if (n == argc)
+                       return;
        } else {
                for (n = 0; n < ifdc; n++)
                        if (fnmatch(ifdv[n], ifr->ifr_name, 0) == 0)
@@ -343,7 +345,7 @@ discover_link(struct interface **ifs, int argc, char * const *argv,
                break;
        }
        free(sdl);
-       if (ifp && ifl)
+       if (ifl)
                ifl->next = ifp;
        else
                *ifs = ifp;