]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make Beacon frame checks less frequent for SSID verification
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 12 Jul 2024 10:13:09 +0000 (13:13 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 12 Jul 2024 10:13:09 +0000 (13:13 +0300)
Instead of checking the latest scan results every second indefinitely,
add more latency between the checks in case the driver does not update
the time stamp value (i.e., does not report new Beacon frames during an
association).

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 64394029dd96bdbdd8013a36a4e78b1943d8b6d6..4fe15e4a3d897cb8257d78a619a9ad10945786f1 100644 (file)
@@ -980,9 +980,11 @@ static void wpas_verify_ssid_beacon(void *eloop_ctx, void *timeout_ctx)
                /* TODO: Multiple BSSID element */
        }
 
-       if (wpa_s->beacons_checked < 16)
-               eloop_register_timeout(1, 0, wpas_verify_ssid_beacon,
-                                      wpa_s, NULL);
+       if (wpa_s->beacons_checked < 16) {
+               eloop_register_timeout(wpa_s->next_beacon_check, 0,
+                                      wpas_verify_ssid_beacon, wpa_s, NULL);
+               wpa_s->next_beacon_check++;
+       }
 }
 
 
@@ -1006,6 +1008,7 @@ static void wpas_verify_ssid_beacon_prot(struct wpa_supplicant *wpa_s)
                   (long long unsigned int) bss->tsf);
        wpa_s->first_beacon_tsf = bss->tsf;
        wpa_s->beacons_checked = 0;
+       wpa_s->next_beacon_check = 1;
        eloop_cancel_timeout(wpas_verify_ssid_beacon, wpa_s, NULL);
        eloop_register_timeout(1, 0, wpas_verify_ssid_beacon, wpa_s, NULL);
 }
index de4b1923bc035e645364408376d4098434bcab54..110a8648c81f181cfde702fb6e57a75ea8ced6cb 100644 (file)
@@ -1614,6 +1614,7 @@ struct wpa_supplicant {
        bool bigtk_set;
        u64 first_beacon_tsf;
        unsigned int beacons_checked;
+       unsigned int next_beacon_check;
 };