From: Jouni Malinen Date: Tue, 10 Jan 2023 10:00:59 +0000 (+0200) Subject: wlantest: Select BSS more carefully for MLO EAPOL-Key cases X-Git-Tag: hostap_2_11~1349 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c866221759ade45ff1a2399afa966c1b9e2806a;p=thirdparty%2Fhostap.git wlantest: Select BSS more carefully for MLO EAPOL-Key cases Prefer a BSS entry that has a matching STA entry when processing EAPOL-Key frames. This avoids issues where some combination of MLD and/or link addresses are used in a sequence that could end up generating two separate STA entries for the same non-AP MLD. Signed-off-by: Jouni Malinen --- diff --git a/wlantest/rx_eapol.c b/wlantest/rx_eapol.c index d2fe1ec4a..67620ca14 100644 --- a/wlantest/rx_eapol.c +++ b/wlantest/rx_eapol.c @@ -102,7 +102,7 @@ static void rx_data_eapol_key_1_of_4(struct wlantest *wt, const u8 *dst, } else { bss = bss_find(wt, bssid); bss_mld = bss_find(wt, src); - if (bss_mld) + if (bss_mld && (!bss || sta_find(bss_mld, src))) bss = bss_get(wt, src); else bss = bss_get(wt, bssid); @@ -349,7 +349,7 @@ static void rx_data_eapol_key_2_of_4(struct wlantest *wt, const u8 *dst, } else { bss = bss_find(wt, bssid); bss_mld = bss_find(wt, dst); - if (bss_mld) + if (bss_mld && (!bss || sta_find(bss_mld, src))) bss = bss_get(wt, dst); else bss = bss_get(wt, bssid); @@ -932,7 +932,7 @@ static void rx_data_eapol_key_3_of_4(struct wlantest *wt, const u8 *dst, } else { bss = bss_find(wt, bssid); bss_mld = bss_find(wt, src); - if (bss_mld) + if (bss_mld && (!bss || sta_find(bss_mld, src))) bss = bss_get(wt, src); else bss = bss_get(wt, bssid); @@ -1164,7 +1164,7 @@ static void rx_data_eapol_key_4_of_4(struct wlantest *wt, const u8 *dst, } else { bss = bss_find(wt, bssid); bss_mld = bss_find(wt, dst); - if (bss_mld) + if (bss_mld && (!bss || sta_find(bss_mld, src))) bss = bss_get(wt, dst); else bss = bss_get(wt, bssid); @@ -1235,7 +1235,7 @@ static void rx_data_eapol_key_1_of_2(struct wlantest *wt, const u8 *dst, } else { bss = bss_find(wt, bssid); bss_mld = bss_find(wt, src); - if (bss_mld) + if (bss_mld && (!bss || sta_find(bss_mld, src))) bss = bss_get(wt, src); else bss = bss_get(wt, bssid); @@ -1372,7 +1372,7 @@ static void rx_data_eapol_key_2_of_2(struct wlantest *wt, const u8 *dst, } else { bss = bss_find(wt, bssid); bss_mld = bss_find(wt, dst); - if (bss_mld) + if (bss_mld && (!bss || sta_find(bss_mld, src))) bss = bss_get(wt, dst); else bss = bss_get(wt, bssid);