From 6ae43bb1032304d9ac2df7af71b70eeeb13b8efb Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 24 Aug 2023 17:34:37 +0300 Subject: [PATCH] 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 --- wlantest/rx_mgmt.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c index d37440a96..74f520cc6 100644 --- a/wlantest/rx_mgmt.c +++ b/wlantest/rx_mgmt.c @@ -962,9 +962,19 @@ static void rx_mgmt_assoc_req(struct wlantest *wt, const u8 *data, size_t len) sta->assocreq_seen = 1; 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, sta); + } } @@ -1253,9 +1263,20 @@ static void rx_mgmt_reassoc_req(struct wlantest *wt, const u8 *data, sta->assocreq_seen = 1; 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, sta); + } if (elems.ftie) { struct wpa_ft_ies parse;