]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Do not update BSS entries for other AP MLDs in PTK cloning
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 10 Aug 2023 09:12:01 +0000 (12:12 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 10 Aug 2023 09:37:47 +0000 (12:37 +0300)
The new PTK migth need to be copied to another MLO STA entry, but that
operation should not modify the MLD MAC address of unrelated AP MLDs.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wlantest/sta.c

index d6110217ccfdb40d88a0c5db3bb1c57df488c0ea..6c6c6235af24c69175a3e889f3ce73163e253e54 100644 (file)
@@ -345,6 +345,9 @@ void sta_new_ptk(struct wlantest *wt, struct wlantest_sta *sta,
 
                        if (!match)
                                continue;
+                       if (os_memcmp(sta->bss->mld_mac_addr,
+                                     osta->bss->mld_mac_addr, ETH_ALEN) != 0)
+                               continue;
                        wpa_printf(MSG_DEBUG,
                                   "Add PTK to another MLO STA entry " MACSTR
                                   " (MLD " MACSTR " --> " MACSTR ") in BSS "
@@ -358,8 +361,6 @@ void sta_new_ptk(struct wlantest *wt, struct wlantest_sta *sta,
                        sta_copy_ptk(osta, ptk);
                        os_memcpy(osta->mld_mac_addr, sta->mld_mac_addr,
                                  ETH_ALEN);
-                       os_memcpy(osta->bss->mld_mac_addr,
-                                 sta->bss->mld_mac_addr, ETH_ALEN);
                }
        }
 }