[PATCH 1/1] Avoid double invocation of wpa_driver_nl80211_sta_remove function from ap_sta_disconnect context.

Jithu Jance jithu.jance at broadcom.com
Mon Jul 4 00:09:12 PDT 2016


Hi Jouni,

For "device_ap_sme" devices, the ap_sta_disconnect call in supplicant
results in two calls to wpa_driver_nl80211_sta_remove.

1) ap_sta_disconnect > hostapd_drv_sta_deauth > wpa_driver_nl80211_sta_remove
2) ap_sta_disconnect > ap_sta_deauth_cb_timeout > ap_sta_remove >
wpa_driver_nl80211_sta_remove

The ap_sta_deauth_cb_timeout is invoked immediately (timeout of [0,0])
for device_ap_sme devices. So the hostapd_drv_sta_deauth call
 can be avoided for devices without WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS set.

+++++++++++++++++++++++++++++++++++++++++++++++++ Example logs
D/wpa_supplicant(16311): p2p-wlan0-0: IEEE 802.1X: Force disconnection
after EAP-Failure

D/wpa_supplicant(16311): nl80211: sta_remove -> DEL_STATION
p2p-wlan0-0 02:90:4c:74:40:14 --> 0 (Success) <===== 1st call
D/wpa_supplicant(16311): ap_sta_disconnect: reschedule ap_handle_timer
timeout for 02:90:4c:74:40:14 (5 seconds -
AP_MAX_INACTIVITY_AFTER_DEAUTH)
D/wpa_supplicant(16311): IEEE 802.1X: 02:90:4c:74:40:14 BE_AUTH
entering state IDLE
D/wpa_supplicant(16311): IEEE 802.1X: 02:90:4c:74:40:14 AUTH_PAE
entering state INITIALIZE
D/wpa_supplicant(16311): EAP: EAP entering state DISABLED
D/wpa_supplicant(16311): Removing STA 02:90:4c:74:40:14 from kernel driver

D/wpa_supplicant(16311): nl80211: sta_remove -> DEL_STATION
p2p-wlan0-0 02:90:4c:74:40:14 --> 0 (Success) <====  2nd call
D/wpa_supplicant(16311): hostapd_logger: STA 02:90:4c:74:40:14 -
MLME-DEAUTHENTICATE.indication(02:90:4c:74:40:14, 23)
D/wpa_supplicant(16311): hostapd_logger: STA 02:90:4c:74:40:14 -
MLME-DELETEKEYS.request(02:90:4c:74:40:14)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Signed-off-by: Jithu Jance <jithujance at gmail.com>
---
 src/ap/sta_info.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
index c36842b..c9b6578 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -1198,7 +1198,8 @@ void ap_sta_disconnect(struct hostapd_data
*hapd, struct sta_info *sta,
        if (sta == NULL && addr)
                sta = ap_get_sta(hapd, addr);

-       if (addr)
+       if (addr && (hapd->iface->drv_flags &
+                       WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS))
                hostapd_drv_sta_deauth(hapd, addr, reason);

        if (sta == NULL)
--
1.9.1




-- 

Jithu Jance



More information about the Hostap mailing list