]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Select BSS more carefully for MLO EAPOL-Key cases
authorJouni Malinen <quic_jouni@quicinc.com>
Tue, 10 Jan 2023 10:00:59 +0000 (12:00 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 10 Jan 2023 10:00:59 +0000 (12:00 +0200)
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 <quic_jouni@quicinc.com>
wlantest/rx_eapol.c

index d2fe1ec4aed98c4e0b7be31a6333157368d25cef..67620ca14d8b44376ab8712d4ef0353c4ae4f598 100644 (file)
@@ -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);