]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - wlantest/rx_data.c
wlantest: Try harder to find a STA entry with PTK for 4-address frames
[thirdparty/hostap.git] / wlantest / rx_data.c
index ce9ab0d14ab49b17888c5f3dd987a3dbd86a491d..bafc33fd95e0579d06e9c57ee5cf12a87836aa8b 100644 (file)
@@ -278,12 +278,15 @@ static void rx_data_bss_prot(struct wlantest *wt,
                        if (sta) {
                                sta->counters[
                                        WLANTEST_STA_COUNTER_PROT_DATA_TX]++;
-                       } else {
+                       }
+                       if (!sta || !sta->ptk_set) {
                                bss2 = bss_find(wt, hdr->addr2);
                                if (bss2) {
-                                       sta = sta_find(bss2, hdr->addr1);
-                                       if (sta)
+                                       sta2 = sta_find(bss2, hdr->addr1);
+                                       if (sta2 && (!sta || sta2->ptk_set)) {
                                                bss = bss2;
+                                               sta = sta2;
+                                       }
                                }
                        }
                } else {