From 9b89df758409f256cde1f01ba43f54b0d91ab84a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 11 Nov 2023 23:20:32 +0200 Subject: [PATCH] WNM: Do not start scan on disassociation imminent if BSSID is set If the local network profile specifies a specific BSSID, there will not be an acceptable alternative AP for the current one. As such, there is not much point in trying to scan and wait for the results to make this conclusion. Skip the scan and reject the BSS transition management request even if that ends up getting disassociated from the BSS that happens the be the only one that the local configuration allows to be used. Signed-off-by: Jouni Malinen --- wpa_supplicant/wnm_sta.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index 89b7ae0bd..ccfc34d20 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -1517,7 +1517,8 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s, if (wpa_s->wnm_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT) { wpa_msg(wpa_s, MSG_INFO, "WNM: Disassociation Imminent - " "Disassociation Timer %u", wpa_s->wnm_dissoc_timer); - if (wpa_s->wnm_dissoc_timer && !wpa_s->scanning) { + if (wpa_s->wnm_dissoc_timer && !wpa_s->scanning && + (!wpa_s->current_ssid || !wpa_s->current_ssid->bssid_set)) { wpa_printf(MSG_DEBUG, "Trying to find another BSS"); wpa_supplicant_req_scan(wpa_s, 0, 0); } @@ -1589,6 +1590,17 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s, return; } + if (wpa_s->current_ssid && wpa_s->current_ssid->bssid_set) { + wpa_printf(MSG_DEBUG, + "WNM: Configuration prevents roaming (BSSID set)"); + wnm_send_bss_transition_mgmt_resp( + wpa_s, wpa_s->wnm_dialog_token, + WNM_BSS_TM_REJECT_NO_SUITABLE_CANDIDATES, + MBO_TRANSITION_REJECT_REASON_UNSPECIFIED, 0, + NULL); + return; + } + wnm_sort_cand_list(wpa_s); wnm_dump_cand_list(wpa_s); valid_ms = valid_int * beacon_int * 128 / 125; -- 2.47.2