]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Accept link removal BSS TM Request
authorJouni Malinen <j@w1.fi>
Sat, 16 Dec 2023 17:45:33 +0000 (19:45 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 16 Dec 2023 17:46:41 +0000 (19:46 +0200)
Instead of rejecting the request, accept it since the AP MLD is in
control of which links are available and we are not being fully
disconnected in this case.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wnm_sta.c
wpa_supplicant/wpa_supplicant_i.h

index a8bd6e86e411251ae0b30589efac0f16aaf5fc21..fa9ab0e3ee34387b902924fc15e1d21ed50a1c4b 100644 (file)
@@ -1091,7 +1091,7 @@ static void wnm_send_bss_transition_mgmt_resp(
                wpabuf_put_data(buf, "\0\0\0\0\0\0", ETH_ALEN);
        }
 
-       if (status == WNM_BSS_TM_ACCEPT)
+       if (status == WNM_BSS_TM_ACCEPT && !wpa_s->wnm_link_removal)
                wnm_add_cand_list(wpa_s, &buf);
 
 #ifdef CONFIG_MBO
@@ -1458,6 +1458,7 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s,
        wpa_s->wnm_dialog_token = pos[0];
        wpa_s->wnm_mode = pos[1];
        wpa_s->wnm_dissoc_timer = WPA_GET_LE16(pos + 2);
+       wpa_s->wnm_link_removal = false;
        valid_int = pos[4];
        wpa_s->wnm_reply = reply;
 
@@ -1531,6 +1532,7 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s,
                wpa_printf(MSG_INFO,
                           "WNM: BTM request for a single MLO link - ignore disassociation imminent since other links remain associated");
                disassoc_imminent = false;
+               wpa_s->wnm_link_removal = true;
        }
 
        if (disassoc_imminent) {
@@ -1673,7 +1675,9 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s,
                wpa_supplicant_req_scan(wpa_s, 0, 0);
        } else if (reply) {
                enum bss_trans_mgmt_status_code status;
-               if (wpa_s->wnm_mode & WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT)
+
+               if ((wpa_s->wnm_mode & WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT) ||
+                   wpa_s->wnm_link_removal)
                        status = WNM_BSS_TM_ACCEPT;
                else {
                        wpa_msg(wpa_s, MSG_INFO, "WNM: BSS Transition Management Request did not include candidates");
index 539c0bc660a63bc02ebeebe7402af4661bfa6525..b3f1cd1b4e1ade0f637db36f3e212ed8ed95fa83 100644 (file)
@@ -1299,6 +1299,7 @@ struct wpa_supplicant {
        u8 wnm_reply;
        u8 wnm_num_neighbor_report;
        u8 wnm_mode;
+       bool wnm_link_removal;
        u16 wnm_dissoc_timer;
        u8 wnm_bss_termination_duration[12];
        struct neighbor_report *wnm_neighbor_report_elements;