[PATCH] hostapd:Avoid disassociation getting in to a loop by moving timeout_next changes to hostapd_new_assoc_sta()

dheeraj.km at globaledgesoft.com dheeraj.km at globaledgesoft.com
Wed Jul 5 09:16:43 PDT 2017


From: dheerajkm <dheeraj.km at globaledgesoft.com>

Problem:
STA's connectivity state machine gets into a loop of sending
disassociation, for previously disassociating STA when no ACK
is received for Association Response within ap_handle_timer timeout.

To Fix this issue, move the
    sta->timeout_next = STA_NULLFUNC;
from handle_assoc() to hostapd_new_assoc_sta().

sta->timeout_next is set to STA_NULLFUNC only when Ack is received
for the Association Response sent out. So if ACK is not received
within AP_DEAUTH_DELAY, STA is deauthenticated and STA context is
cleaned up. Due to which there needs to be a new session started
by STA with AUTH Req.
---
 src/ap/hostapd.c    | 4 ++++
 src/ap/ieee802_11.c | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 270e818..c167fcb 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -2868,6 +2868,10 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
 	} else
 		wpa_auth_sta_associated(hapd->wpa_auth, sta->wpa_sm);
 
+	/* Make sure that the previously registered inactivity timer will not
+	 * remove the STA immediately. */
+	sta->timeout_next = STA_NULLFUNC;
+
 	if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_WIRED) {
 		if (eloop_cancel_timeout(ap_handle_timer, hapd, sta) > 0) {
 			wpa_printf(MSG_DEBUG,
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 3e0a2dd..69ed693 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -3120,10 +3120,6 @@ static void handle_assoc(struct hostapd_data *hapd,
 	}
 #endif /* CONFIG_IEEE80211W */
 
-	/* Make sure that the previously registered inactivity timer will not
-	 * remove the STA immediately. */
-	sta->timeout_next = STA_NULLFUNC;
-
 #ifdef CONFIG_TAXONOMY
 	taxonomy_sta_info_assoc_req(hapd, sta, pos, left);
 #endif /* CONFIG_TAXONOMY */
-- 
1.9.1

Disclaimer:- The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. The views expressed in this E-mail message (including the enclosure/(s) or attachment/(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of GlobalEdge. Before opening any mail and attachments please check them for viruses .GlobalEdge does not accept any liability for virus infected mails.




More information about the Hostap mailing list