]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PASN: Clear driver/firwmare ranging context if PASN Auth 1 fails
authorKhanjan Desai <khanjan@qti.qualcomm.com>
Wed, 4 Dec 2024 13:05:39 +0000 (18:35 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 14 Aug 2025 20:05:22 +0000 (23:05 +0300)
When PASN auth 1 frame does not get an ack or gets failure, the call to
ap_free_sta() clears the hostapd context but the driver/firmware is not
aware of this and as such, still holds the context making it impossible
to initiate next PASN request.

Clear PASN context in underlying drivers by setting NULL context with
hostapd_drv_set_secure_ranging_ctx().

Signed-off-by: Khanjan Desai <khanjan@qti.qualcomm.com>
src/ap/ieee802_11.c

index 866a1c1c89bceeb411b78e572a4d1c1a4de5e33d..7c461d48ed110b106174b4895eb34337a981e60f 100644 (file)
@@ -3046,8 +3046,12 @@ static void handle_auth_pasn(struct hostapd_data *hapd, struct sta_info *sta,
                                         mgmt, len, false);
                wpabuf_free(sta->pasn->frame);
                sta->pasn->frame = NULL;
-               if (ret < 0)
+               if (ret < 0) {
+                       hostapd_drv_set_secure_ranging_ctx(hapd, hapd->own_addr,
+                                                          sta->addr, 0, 0,
+                                                          NULL, 0, NULL, 1);
                        ap_free_sta(hapd, sta);
+               }
        } else if (trans_seq == 3) {
                if (!sta->pasn) {
                        wpa_printf(MSG_DEBUG,