Fix BSS age underflow
While checking for stale BSSes, the current time is used as a basis and then based on age the stale check time is calculated, but if this is done too early in the boot and if either BOOTTIME/MONOTONIC (the one Zephyr uses by default) are used then the stale check time underflows and goes to future causing active BSS entries in the scan to be treated as stale and flushed. Fix this by adding a check before calculating stale time and ignore this check till the system reaches the BSS expiration time (this would never happen with REALTIME clock). Signed-off-by: Krishna T <krishna.t@nordicsemi.no> Signed-off-by: Sridhar Nuvusetty <sridhar.nuvusetty@nordicsemi.no>
This commit is contained in:
parent
047da5fe3a
commit
12de8112b7
1 changed files with 4 additions and 0 deletions
|
@ -986,6 +986,10 @@ void wpa_bss_flush_by_age(struct wpa_supplicant *wpa_s, int age)
|
|||
return;
|
||||
|
||||
os_get_reltime(&t);
|
||||
|
||||
if (t.sec < age)
|
||||
return; /* avoid underflow; there can be no older entries */
|
||||
|
||||
t.sec -= age;
|
||||
|
||||
dl_list_for_each_safe(bss, n, &wpa_s->bss, struct wpa_bss, list) {
|
||||
|
|
Loading…
Reference in a new issue