[PATCH usteer 1/5] nl80211: fix connected time wraparound

Patrick Hein bagbag98 at googlemail.com
Sun Oct 25 10:38:32 PDT 2026


The connected time is converted to milliseconds in 32 bits, which wraps
after 49.7 days of association. connected_since then jumps forward: the
"connected" time reported over ubus restarts at zero, and the roam
trigger skips the station for another roam_trigger_interval, as if it
had just connected.

Convert in 64 bits.

Fixes: 837f144f6cd8 ("usteer: add connected-since")
Signed-off-by: Patrick Hein <bagbag98 at googlemail.com>
---
 nl80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nl80211.c b/nl80211.c
index a232505..54ff842 100644
--- a/nl80211.c
+++ b/nl80211.c
@@ -271,7 +271,7 @@ static void nl80211_update_sta(struct usteer_node *node, struct sta_info *si)
 		signal = (int8_t) nla_get_u8(tb_sta[NL80211_STA_INFO_SIGNAL_AVG]);
 	
 	if (tb_sta[NL80211_STA_INFO_CONNECTED_TIME])
-		si->connected_since = current_time - (nla_get_u32(tb_sta[NL80211_STA_INFO_CONNECTED_TIME]) * 1000);
+		si->connected_since = current_time - (uint64_t)nla_get_u32(tb_sta[NL80211_STA_INFO_CONNECTED_TIME]) * 1000;
 
 	usteer_sta_info_update(si, signal, true);
 
-- 
2.56.0




More information about the openwrt-devel mailing list