]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix TKIP countermeasures stopping in deinit paths
authorJouni Malinen <j@w1.fi>
Sun, 30 Oct 2011 10:43:30 +0000 (12:43 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 30 Oct 2011 10:53:20 +0000 (12:53 +0200)
The eloop timeout to stop TKIP countermeasures has to be canceled
on deinit path to avoid leaving bogus timeouts behind.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/ap/tkip_countermeasures.c
src/ap/tkip_countermeasures.h
src/ap/wpa_auth_glue.c
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 38e0b2b57204304d971bd2ca80e732cc2a079495..fac7f4b4ce5ebb28141f48394fe8637ecf9fd064 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * hostapd / TKIP countermeasures
- * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2002-2011, Jouni Malinen <j@w1.fi>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -60,6 +60,12 @@ static void ieee80211_tkip_countermeasures_start(struct hostapd_data *hapd)
 }
 
 
+void ieee80211_tkip_countermeasures_deinit(struct hostapd_data *hapd)
+{
+       eloop_cancel_timeout(ieee80211_tkip_countermeasures_stop, hapd, NULL);
+}
+
+
 void michael_mic_failure(struct hostapd_data *hapd, const u8 *addr, int local)
 {
        struct os_time now;
index 5a1afceb0314879ac9ede6801ed8ff56de21f171..a8ffd1641f3fc05c948f57a1a0c44f9303cad30a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * hostapd / TKIP countermeasures
- * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2002-2011, Jouni Malinen <j@w1.fi>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -16,5 +16,6 @@
 #define TKIP_COUNTERMEASURES_H
 
 void michael_mic_failure(struct hostapd_data *hapd, const u8 *addr, int local);
+void ieee80211_tkip_countermeasures_deinit(struct hostapd_data *hapd);
 
 #endif /* TKIP_COUNTERMEASURES_H */
index af239c8e59a4f07b65a33b2938f46590c372015d..d44381da8b97dd66f89d51ad2cdea0e85cfa54e0 100644 (file)
@@ -548,6 +548,7 @@ void hostapd_reconfig_wpa(struct hostapd_data *hapd)
 
 void hostapd_deinit_wpa(struct hostapd_data *hapd)
 {
+       ieee80211_tkip_countermeasures_deinit(hapd);
        rsn_preauth_iface_deinit(hapd);
        if (hapd->wpa_auth) {
                wpa_deinit(hapd->wpa_auth);
index d86fe111869549d7f49705dd7936e50f6167f830..80ca8696fdb6633b4bd3348f8d93a012e88e3dab 100644 (file)
@@ -96,8 +96,7 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s)
 }
 
 
-static void wpa_supplicant_stop_countermeasures(void *eloop_ctx,
-                                               void *sock_ctx)
+void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx)
 {
        struct wpa_supplicant *wpa_s = eloop_ctx;
 
@@ -1584,8 +1583,7 @@ static void wpa_supplicant_event_disassoc(struct wpa_supplicant *wpa_s,
 
 
 #ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
-static void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx,
-                                                   void *sock_ctx)
+void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx)
 {
        struct wpa_supplicant *wpa_s = eloop_ctx;
 
index 058feed1e80de044353ef7830626c936a3da3d41..c6787da399c0ece3d9abb63bec3d83be24af3ea5 100644 (file)
@@ -434,6 +434,11 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
 
        wpa_supplicant_cancel_scan(wpa_s);
        wpa_supplicant_cancel_auth_timeout(wpa_s);
+       eloop_cancel_timeout(wpa_supplicant_stop_countermeasures, wpa_s, NULL);
+#ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
+       eloop_cancel_timeout(wpa_supplicant_delayed_mic_error_report,
+                            wpa_s, NULL);
+#endif /* CONFIG_DELAYED_MIC_ERROR_REPORT */
 
        wpas_wps_deinit(wpa_s);
 
index 3e6e5dd74939933f7081d2bf94e9113f2f1325f3..fd04a7d0adb04048cbcf6f0b133914834321643f 100644 (file)
@@ -585,6 +585,8 @@ void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
 int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
                           struct wpa_bss *selected,
                           struct wpa_ssid *ssid);
+void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx);
+void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx);
 
 /* eap_register.c */
 int eap_register_methods(void);