summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-09-02 20:10:55 +0000
committerRoy Marples <roy@marples.name>2009-09-02 20:10:55 +0000
commitf17d91d410d489a18d7a8edf67b72f5088b7f6dd (patch)
treeb78c96b4957274571e66d76a01ce7c49dd9340f0
parent20e16f04803ff3a658f13d052ccd448f5421c814 (diff)
downloaddhcpcd-f17d91d410d489a18d7a8edf67b72f5088b7f6dd.tar.xz
We should not affect other interfaces when handling new interface
notifications.
-rw-r--r--dhcpcd.c3
-rw-r--r--net.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 548f0152..1e5a95ea 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1187,6 +1187,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) {
@@ -1208,7 +1209,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 b00e012b..83de3b41 100644
--- a/net.c
+++ b/net.c
@@ -308,6 +308,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;