From: Yogesh Ashok Powar Date: Sat, 15 Oct 2011 09:41:28 +0000 (+0300) Subject: Disconnect STA when it fails to get added in kernel driver/firmware X-Git-Tag: hostap-1-bp~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8666585b9ef5b758d52518925b711eba28b631d4;p=thirdparty%2Fhostap.git Disconnect STA when it fails to get added in kernel driver/firmware 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 Signed-off-by: Nishant Sarmukadam --- diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index e5a0a85f3..7293957a4 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); + + goto fail; } if (sta->flags & WLAN_STA_WDS)