]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Do not start scan on disassociation imminent if BSSID is set
authorJouni Malinen <j@w1.fi>
Sat, 11 Nov 2023 21:20:32 +0000 (23:20 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 11 Nov 2023 21:44:04 +0000 (23:44 +0200)
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 <j@w1.fi>
wpa_supplicant/wnm_sta.c

index 89b7ae0bd40db6123baf26109f88d1c6f4d653f3..ccfc34d20ba269902915e2193e534d0b7beb5a93 100644 (file)
@@ -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;