summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-09-02 20:10:23 +0000
committerRoy Marples <roy@marples.name>2009-09-02 20:10:23 +0000
commit20e16f04803ff3a658f13d052ccd448f5421c814 (patch)
tree38c8f10623cf63579ceb036a4ae93d1ab7c94590
parent1c1768c0c42002da3899972087c01c950f7a7291 (diff)
downloaddhcpcd-20e16f04803ff3a658f13d052ccd448f5421c814.tar.xz
Don't pass "dhcpcd $iface" to discover_interfaces so our
denyinterfaces config option works for hotplugged interfaces.
-rw-r--r--dhcpcd.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 716b5ef6..548f0152 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1187,7 +1187,6 @@ void
handle_interface(int action, const char *ifname)
{
struct interface *ifs, *ifp, *ifn, *ifl = NULL;
- const char * const argv[] = { "dhcpcd", ifname };
int i;
if (action == -1) {
@@ -1209,23 +1208,24 @@ handle_interface(int action, const char *ifname)
return;
}
- if ((ifs = discover_interfaces(2, UNCONST(argv)))) {
- for (ifp = ifs; ifp; ifp = ifp->next) {
- /* Check if we already have the interface */
- for (ifn = ifaces; ifn; ifn = ifn->next) {
- if (strcmp(ifn->name, ifp->name) == 0)
- break;
- ifl = ifn;
- }
- if (ifn)
- continue;
- init_state(ifp, 2, UNCONST(argv));
- if (ifl)
- ifl->next = ifp;
- else
- ifaces = ifp;
- start_interface(ifp);
+ ifs = discover_interfaces(0, NULL);
+ for (ifp = ifs; ifp; ifp = ifp->next) {
+ if (strcmp(ifp->name, ifname) != 0)
+ continue;
+ /* Check if we already have the interface */
+ for (ifn = ifaces; ifn; ifn = ifn->next) {
+ if (strcmp(ifn->name, ifp->name) == 0)
+ break;
+ ifl = ifn;
}
+ if (ifn)
+ continue;
+ init_state(ifp, 0, NULL);
+ if (ifl)
+ ifl->next = ifp;
+ else
+ ifaces = ifp;
+ start_interface(ifp);
}
}