aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-03-15 13:02:08 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-22 15:41:37 (GMT)
commit45e3fc72c61a61dbd1e2fc3fd9fd7bf853b9f5fe (patch)
treeb677bf535bb04be1ee42a7fcce53613ded9104cd /wpa_supplicant/events.c
parent90377029c6805b339dfa3307263118986295796a (diff)
downloadhostap-45e3fc72c61a61dbd1e2fc3fd9fd7bf853b9f5fe.zip
hostap-45e3fc72c61a61dbd1e2fc3fd9fd7bf853b9f5fe.tar.gz
hostap-45e3fc72c61a61dbd1e2fc3fd9fd7bf853b9f5fe.tar.bz2
Find correct driver for interface additions/removals
Interface additions/removals are not guaranteed to be for the driver listening to the kernel events. As such, send the events to wpa_supplicant_event_global() which can then pick the correct interface registered with wpa_supplicant to send the event to. Signed-off-by: Roy Marples <roy@marples.name>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index d770107..833f5a0 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -4008,3 +4008,29 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
break;
}
}
+
+
+void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data)
+{
+ struct wpa_supplicant *wpa_s;
+
+ if (event != EVENT_INTERFACE_STATUS)
+ return;
+
+ wpa_s = wpa_supplicant_get_iface(ctx, data->interface_status.ifname);
+ if (wpa_s && wpa_s->driver->get_ifindex) {
+ unsigned int ifindex;
+
+ ifindex = wpa_s->driver->get_ifindex(wpa_s->drv_priv);
+ if (ifindex != data->interface_status.ifindex) {
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "interface status ifindex %d mismatch (%d)",
+ ifindex, data->interface_status.ifindex);
+ return;
+ }
+ }
+
+ if (wpa_s)
+ wpa_supplicant_event(wpa_s, event, data);
+}