wlantest: Learn the Link ID for AP MLD affiliated BSSs

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>
This commit is contained in:
Jouni Malinen 2023-08-24 17:28:33 +03:00 committed by Jouni Malinen
parent 37c87efecf
commit 19f33d7929
2 changed files with 14 additions and 0 deletions

View 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;

View 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];