From 5c866221759ade45ff1a2399afa966c1b9e2806a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 10 Jan 2023 12:00:59 +0200 Subject: [PATCH] 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 --- wlantest/rx_eapol.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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); -- 2.47.2