]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
We should not affect other interfaces when handling new interface
authorRoy Marples <roy@marples.name>
Tue, 1 Sep 2009 07:45:11 +0000 (07:45 +0000)
committerRoy Marples <roy@marples.name>
Tue, 1 Sep 2009 07:45:11 +0000 (07:45 +0000)
notifications.

dhcpcd.c
net.c

index 2cbb63202bf04cac49c4b967466b0199dc6b5232..7054687a10e548ef58572c67ccf738ab253cca78 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1188,6 +1188,7 @@ void
 handle_interface(int action, const char *ifname)
 {
        struct interface *ifs, *ifp, *ifn, *ifl = NULL;
+       const char * const argv[] = { ifname }; 
        int i;
 
        if (action == -1) {
@@ -1209,7 +1210,7 @@ handle_interface(int action, const char *ifname)
                        return;
        }
 
-       ifs = discover_interfaces(0, NULL);
+       ifs = discover_interfaces(-1, UNCONST(argv));
        for (ifp = ifs; ifp; ifp = ifp->next) {
                if (strcmp(ifp->name, ifname) != 0)
                        continue;
diff --git a/net.c b/net.c
index 1ff798c9ddb8c9962614c1dd640e1156e0a9b5e5..b9b756816796deaa98d55e72a274c16c37ea5957 100644 (file)
--- a/net.c
+++ b/net.c
@@ -307,6 +307,11 @@ discover_interfaces(int argc, char * const *argv)
                                continue;
                        p = argv[i];
                } else {
+                       /* -1 means we're discovering against a specific
+                        * interface, but we still need the below rules
+                        * to apply. */
+                       if (argc == -1 && strcmp(argv[0], ifa->ifa_name) != 0)
+                               continue;
                        for (i = 0; i < ifdc; i++)
                                if (!fnmatch(ifdv[i], ifa->ifa_name, 0))
                                        break;