]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Learn link address for assoc link from (Re)Association Request
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 24 Aug 2023 14:34:37 +0000 (17:34 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 24 Aug 2023 15:10:47 +0000 (18:10 +0300)
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>
wlantest/rx_mgmt.c

index d37440a964ed7cf6d5ade37e320e03b7cd2ed7ad..74f520cc60dc9b0e5685985e6e5099f9267479a9 100644 (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_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;