]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Handle BTM request with Link Removal Imminent field set to 1
authorIlan Peer <ilan.peer@intel.com>
Wed, 13 Dec 2023 14:04:10 +0000 (16:04 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 16 Dec 2023 17:12:23 +0000 (19:12 +0200)
Based on IEEE P802.11be/D5.0, when a station is non-AP MLD with more
than one link the combination of the Link Removal Imminent field set to
1 and the BSS Termination Included field set to 1 means than only one of
the links is removed while the other links will remains associated.
Handle this case without starting a scan to find another BSS.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
src/common/ieee802_11_defs.h
wpa_supplicant/wnm_sta.c

index cd33f6a8f556db6b89e84750b1f341c7f8946de6..9bf98518e388df9c776202ce45c15b98c95627a6 100644 (file)
@@ -1885,6 +1885,7 @@ enum wnm_action {
 #define WNM_BSS_TM_REQ_DISASSOC_IMMINENT BIT(2)
 #define WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED BIT(3)
 #define WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT BIT(4)
+#define WNM_BSS_TM_REQ_LINK_REMOVAL_IMMINENT BIT(5)
 
 /* IEEE Std 802.11-2012 - Table 8-253 */
 enum bss_trans_mgmt_status_code {
index 2cd5edd39c79e8a7fc7f9d6b02b7b470fde2f577..a8bd6e86e411251ae0b30589efac0f16aaf5fc21 100644 (file)
@@ -1437,6 +1437,7 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s,
 #ifdef CONFIG_MBO
        const u8 *vendor;
 #endif /* CONFIG_MBO */
+       bool disassoc_imminent;
 
        if (wpa_s->disable_mbo_oce || wpa_s->conf->disable_btm)
                return;
@@ -1514,7 +1515,25 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s,
                        wpa_s->wnm_dissoc_timer * beacon_int * 128 / 125, url);
        }
 
-       if (wpa_s->wnm_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT) {
+       disassoc_imminent = wpa_s->wnm_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT;
+
+       /*
+        * Based on IEEE P802.11be/D5.0, when a station is a non-AP MLD with
+        * more than one affiliated link, the Link Removal Imminent field is
+        * set to 1, and the BSS Termination Included field is set to 1, only
+        * one of the links is removed and the other links remain associated.
+        * Ignore the Disassociation Imminent field in such a case.
+        */
+       if (disassoc_imminent &&
+           (wpa_s->valid_links & (wpa_s->valid_links - 1)) != 0 &&
+           (wpa_s->wnm_mode & WNM_BSS_TM_REQ_LINK_REMOVAL_IMMINENT) &&
+           (wpa_s->wnm_mode & WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED)) {
+               wpa_printf(MSG_INFO,
+                          "WNM: BTM request for a single MLO link - ignore disassociation imminent since other links remain associated");
+               disassoc_imminent = false;
+       }
+
+       if (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 &&