diff --git a/wlantest/bss.c b/wlantest/bss.c index f34f674dd..64e4421ae 100644 --- a/wlantest/bss.c +++ b/wlantest/bss.c @@ -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; diff --git a/wlantest/wlantest.h b/wlantest/wlantest.h index befe09f87..3668c753f 100644 --- a/wlantest/wlantest.h +++ b/wlantest/wlantest.h @@ -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];