[PATCH] hostapd: Disconnect STA when it fails to get added in kernel driver/firmware

Yogesh Ashok Powar yogeshp at marvell.com
Thu Oct 13 07:30:24 EDT 2011


Data path for stations that get successfully associated to the
hostapd but fail to get added in the driver/firmware, will not
work. In such cases, hostapd should deauth and disconnect such
stations. In such scenario, hostapd should disconnect the STAs.

Sample output with following patch
>wlan0: STA 0c:74:c2:9a:4c:59 IEEE 802.11: authenticated
>wlan0: STA 0c:74:c2:9a:4c:59 IEEE 802.11: associated (aid 1)
>wlan0: AP-STA-CONNECTED 0c:74:c2:9a:4c:59
>wlan0: STA 0c:74:c2:9a:4c:59 IEEE 802.11: Could not add STA to kernel driver
>wlan0: STA 0c:74:c2:9a:4c:59 IEEE 802.11: deauthenticated due to local
>deauth request

Signed-off-by: Yogesh Ashok Powar <yogeshp at marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants at marvell.com>
---
 src/ap/ieee802_11.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index e5a0a85..8eae22a 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -1714,6 +1714,11 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
 		hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
 			       HOSTAPD_LEVEL_NOTICE,
 			       "Could not add STA to kernel driver");
+
+		ap_sta_disconnect(hapd, sta, sta->addr,
+				  WLAN_REASON_DISASSOC_AP_BUSY);
+
+		return;
 	}
 
 	if (sta->flags & WLAN_STA_WDS)
-- 
1.7.0.4



More information about the HostAP mailing list