From f3a841bbff689cf4e89831afe3192ff4d955c504 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 11 Feb 2019 17:37:08 +0200 Subject: [PATCH] Do not disassociate not-associated STA on timeout 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 --- src/ap/sta_info.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index 8858a3425..4a7722c28 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -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",