aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-04-03 16:17:38 +0300
committerJouni Malinen <j@w1.fi>2012-04-03 16:17:38 +0300
commit52b2004285a82074ce74ff66230d61c2253d54f6 (patch)
tree5b20c6552f4d7b3fd628a4fdac1cd407151b5fce /src/ap
parent1ed08baf89e455d0d087fb1e7177bc5f07b4d7ac (diff)
downloadexternal_wpa_supplicant_8_ti-52b2004285a82074ce74ff66230d61c2253d54f6.zip
external_wpa_supplicant_8_ti-52b2004285a82074ce74ff66230d61c2253d54f6.tar.gz
external_wpa_supplicant_8_ti-52b2004285a82074ce74ff66230d61c2253d54f6.tar.bz2
Change reason code for AP mode BSS termination to 3
Use reason code 3 (Deauthenticated because sending STA is leaving) instead of reason code 2 (Previous authentication ot valid) in the Deauthentication frame sent at the time a BSS is terminated. This is more accurate reason for the message and allows the stations to get better understand on why they were disconnected. This can be useful especially for P2P clients that can use this as a signal that the P2P group session was ended per P2P specification section 3.2.9. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/ap')
-rw-r--r--src/ap/hostapd.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index bb8fea7..03917bc 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -33,7 +33,7 @@
#include "gas_serv.h"
-static int hostapd_flush_old_stations(struct hostapd_data *hapd);
+static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason);
static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd);
static int hostapd_broadcast_wep_clear(struct hostapd_data *hapd);
@@ -123,7 +123,8 @@ int hostapd_reload_config(struct hostapd_iface *iface)
* allow them to use the BSS anymore.
*/
for (j = 0; j < iface->num_bss; j++) {
- hostapd_flush_old_stations(iface->bss[j]);
+ hostapd_flush_old_stations(iface->bss[j],
+ WLAN_REASON_PREV_AUTH_NOT_VALID);
hostapd_broadcast_wep_clear(iface->bss[j]);
#ifndef CONFIG_NO_RADIUS
@@ -376,7 +377,7 @@ static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd)
}
-static int hostapd_flush_old_stations(struct hostapd_data *hapd)
+static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason)
{
int ret = 0;
u8 addr[ETH_ALEN];
@@ -392,7 +393,7 @@ static int hostapd_flush_old_stations(struct hostapd_data *hapd)
}
wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "Deauthenticate all stations");
os_memset(addr, 0xff, ETH_ALEN);
- hostapd_drv_sta_deauth(hapd, addr, WLAN_REASON_PREV_AUTH_NOT_VALID);
+ hostapd_drv_sta_deauth(hapd, addr, reason);
hostapd_free_stas(hapd);
return ret;
@@ -562,7 +563,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
if (conf->wmm_enabled < 0)
conf->wmm_enabled = hapd->iconf->ieee80211n;
- hostapd_flush_old_stations(hapd);
+ hostapd_flush_old_stations(hapd, WLAN_REASON_PREV_AUTH_NOT_VALID);
hostapd_set_privacy(hapd, 0);
hostapd_broadcast_wep_clear(hapd);
@@ -924,7 +925,7 @@ void hostapd_interface_deinit(struct hostapd_iface *iface)
for (j = 0; j < iface->num_bss; j++) {
struct hostapd_data *hapd = iface->bss[j];
hostapd_free_stas(hapd);
- hostapd_flush_old_stations(hapd);
+ hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING);
hostapd_clear_wep(hapd);
hostapd_cleanup(hapd);
}