Make Beacon frame checks less frequent for SSID verification

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>
This commit is contained in:
Jouni Malinen 2024-07-12 13:13:09 +03:00 committed by Jouni Malinen
parent b946a800f0
commit 1023654532
2 changed files with 7 additions and 3 deletions

View 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);
}

View file

@ -1614,6 +1614,7 @@ struct wpa_supplicant {
bool bigtk_set;
u64 first_beacon_tsf;
unsigned int beacons_checked;
unsigned int next_beacon_check;
};