]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Learn the Link ID for AP MLD affiliated BSSs
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 24 Aug 2023 14:28:33 +0000 (17:28 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 24 Aug 2023 15:10:47 +0000 (18:10 +0300)
This allows the Link ID to be determined based on the BSS entry when
processing a frame.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wlantest/bss.c
wlantest/wlantest.h

index f34f674dd1959589c0de10f579454a0ba22ed3ab..64e4421ae3a803612d2486b562a423265e76c37f 100644 (file)
@@ -254,6 +254,18 @@ void bss_update(struct wlantest *wt, struct wlantest_bss *bss,
                           MAC2STR(bss->mld_mac_addr), MAC2STR(bss->bssid));
        }
 
+       if (!bss->link_id_set &&
+           elems->basic_mle && elems->basic_mle_len >= 2 + 1 + ETH_ALEN + 1 &&
+           elems->basic_mle[2] >= 1 + ETH_ALEN + 1 &&
+           (WPA_GET_LE16(elems->basic_mle) &
+            BASIC_MULTI_LINK_CTRL_PRES_LINK_ID)) {
+                   bss->link_id = elems->basic_mle[2 + 1 + ETH_ALEN] & 0x0f;
+                   wpa_printf(MSG_DEBUG,
+                              "Learned AP MLD Link ID %u for this affiliated link",
+                              bss->link_id);
+                   bss->link_id_set = true;
+       }
+
        if (!update)
                return;
 
index befe09f87b583c610707b8ed57ea70b713f21947..3668c753fa207e8e6940f4b330cdd148ab603b15 100644 (file)
@@ -144,6 +144,8 @@ struct wlantest_bss {
        struct dl_list list;
        u8 bssid[ETH_ALEN];
        u8 mld_mac_addr[ETH_ALEN];
+       u8 link_id;
+       bool link_id_set;
        u16 capab_info;
        u16 prev_capab_info;
        u8 ssid[32];