changeset 1398:51f62c97d6f3 draft

We should not affect other interfaces when handling new interface notifications.
author Roy Marples <roy@marples.name>
date Tue, 01 Sep 2009 07:45:11 +0000
parents e5ef001c8cc2
children 1b2b2711c1a8
files dhcpcd.c net.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dhcpcd.c	Mon Aug 31 21:51:17 2009 +0000
+++ b/dhcpcd.c	Tue Sep 01 07:45:11 2009 +0000
@@ -1188,6 +1188,7 @@
 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 @@
 			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;
--- a/net.c	Mon Aug 31 21:51:17 2009 +0000
+++ b/net.c	Tue Sep 01 07:45:11 2009 +0000
@@ -307,6 +307,11 @@
 				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;