]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Do not disassociate not-associated STA on timeout
authorJouni Malinen <jouni@codeaurora.org>
Mon, 11 Feb 2019 15:37:08 +0000 (17:37 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 11 Feb 2019 15:42:53 +0000 (17:42 +0200)
If the ap_handle_timer() timeout is reached for a not-associated STA, do
not default to disassociating that STA first since Disassociation frame
is not really appropriate to send to a STA that is not in associated
state. Instead, skip directly to deauthentication and STA entry removal.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/sta_info.c

index 8858a3425907468f871d449e84e950daa3614259..4a7722c28bcaca85d6f8e559a238de83af3f86f6 100644 (file)
@@ -501,6 +501,13 @@ skip_poll:
        } else if (sta->timeout_next != STA_REMOVE) {
                int deauth = sta->timeout_next == STA_DEAUTH;
 
+               if (!deauth && !(sta->flags & WLAN_STA_ASSOC)) {
+                       /* Cannot disassociate not-associated STA, so move
+                        * directly to deauthentication. */
+                       sta->timeout_next = STA_DEAUTH;
+                       deauth = 1;
+               }
+
                wpa_dbg(hapd->msg_ctx, MSG_DEBUG,
                        "Timeout, sending %s info to STA " MACSTR,
                        deauth ? "deauthentication" : "disassociation",