aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-06-25 13:53:24 +0300
committerJouni Malinen <j@w1.fi>2012-06-25 13:53:24 +0300
commit296a34f0c1730416bf2a61ab78690be43d82a3c0 (patch)
treeccb71831fca7de9ebd32eabd8bec429a71c5406d /src/ap
parent9148ae58d04ac9baed3d56a70ce594492dab3769 (diff)
downloadexternal_wpa_supplicant_8_ti-296a34f0c1730416bf2a61ab78690be43d82a3c0.zip
external_wpa_supplicant_8_ti-296a34f0c1730416bf2a61ab78690be43d82a3c0.tar.gz
external_wpa_supplicant_8_ti-296a34f0c1730416bf2a61ab78690be43d82a3c0.tar.bz2
Remove STA entry from AP when starting TKIP countermeasures
Previously, the STA entry was removed only from the driver and the STA entry within hostapd was just marked disassociated. However, this left the WPA authenticator state machine with an entry and the session was not terminated properly. In addition, the STA entry could have remaining indefinitely if the STA did not reconnect after TKIP countermeasures. Fix this by removing the STA entry from hostapd instead of just leaving it disassociated. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/ap')
-rw-r--r--src/ap/tkip_countermeasures.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ap/tkip_countermeasures.c b/src/ap/tkip_countermeasures.c
index 60088ee..dd5aa68 100644
--- a/src/ap/tkip_countermeasures.c
+++ b/src/ap/tkip_countermeasures.c
@@ -1,6 +1,6 @@
/*
* hostapd / TKIP countermeasures
- * Copyright (c) 2002-2011, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2002-2012, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
@@ -11,6 +11,7 @@
#include "utils/common.h"
#include "utils/eloop.h"
#include "common/ieee802_11_defs.h"
+#include "radius/radius.h"
#include "hostapd.h"
#include "sta_info.h"
#include "ap_mlme.h"
@@ -44,12 +45,17 @@ static void ieee80211_tkip_countermeasures_start(struct hostapd_data *hapd)
eloop_cancel_timeout(ieee80211_tkip_countermeasures_stop, hapd, NULL);
eloop_register_timeout(60, 0, ieee80211_tkip_countermeasures_stop,
hapd, NULL);
- for (sta = hapd->sta_list; sta != NULL; sta = sta->next) {
+ while ((sta = hapd->sta_list)) {
+ sta->acct_terminate_cause =
+ RADIUS_ACCT_TERMINATE_CAUSE_ADMIN_RESET;
+ if (sta->flags & WLAN_STA_AUTH) {
+ mlme_deauthenticate_indication(
+ hapd, sta,
+ WLAN_REASON_MICHAEL_MIC_FAILURE);
+ }
hostapd_drv_sta_deauth(hapd, sta->addr,
WLAN_REASON_MICHAEL_MIC_FAILURE);
- ap_sta_set_authorized(hapd, sta, 0);
- sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC);
- hostapd_drv_sta_remove(hapd, sta->addr);
+ ap_free_sta(hapd, sta);
}
}