[PATCH] Fix BSS age underflow

Johannes Berg johannes at sipsolutions.net
Tue Jan 10 08:58:31 PST 2023

On Tue, 2023-01-10 at 01:39 +0530, chaitanya.mgit at gmail.com wrote:
> From: Krishna T <krishna.t at nordicsemi.no>
> 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).

Makes sense, the REALTIME mention kind of threw me off at first though.

But I think there are probably more cases? Maybe we need some kind of
helper for the actual check, something like "check_age(item_ts, now_ts,


More information about the Hostap mailing list