wlantest: Learn link address for assoc link from (Re)Association Request

Store the non-AP MLD link address of the link that is used for
association when processing (Re)Association Request frames. This is
needed to get the full set of link addresses when 4-way handshake is not
used (e.g., for FT protocol).

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2023-08-24 17:34:37 +03:00 committed by Jouni Malinen
parent 19f33d7929
commit 6ae43bb103

View file

@ -962,9 +962,19 @@ static void rx_mgmt_assoc_req(struct wlantest *wt, const u8 *data, size_t len)
sta->assocreq_seen = 1; sta->assocreq_seen = 1;
sta_update_assoc(sta, &elems); sta_update_assoc(sta, &elems);
if (elems.basic_mle) if (elems.basic_mle) {
if (bss->link_id_set) {
os_memcpy(sta->link_addr[bss->link_id], mgmt->sa,
ETH_ALEN);
wpa_printf(MSG_DEBUG,
"Learned Link ID %u MAC address "
MACSTR
" from Association Request (assoc link)",
bss->link_id, MAC2STR(mgmt->sa));
}
parse_basic_ml(elems.basic_mle, elems.basic_mle_len, false, parse_basic_ml(elems.basic_mle, elems.basic_mle_len, false,
sta); sta);
}
} }
@ -1253,9 +1263,20 @@ static void rx_mgmt_reassoc_req(struct wlantest *wt, const u8 *data,
sta->assocreq_seen = 1; sta->assocreq_seen = 1;
sta_update_assoc(sta, &elems); sta_update_assoc(sta, &elems);
if (elems.basic_mle) if (elems.basic_mle) {
os_memset(sta->link_addr, 0, sizeof(sta->link_addr));
if (bss->link_id_set) {
os_memcpy(sta->link_addr[bss->link_id], mgmt->sa,
ETH_ALEN);
wpa_printf(MSG_DEBUG,
"Learned Link ID %u MAC address "
MACSTR
" from Reassociation Request (assoc link)",
bss->link_id, MAC2STR(mgmt->sa));
}
parse_basic_ml(elems.basic_mle, elems.basic_mle_len, false, parse_basic_ml(elems.basic_mle, elems.basic_mle_len, false,
sta); sta);
}
if (elems.ftie) { if (elems.ftie) {
struct wpa_ft_ies parse; struct wpa_ft_ies parse;