]> www.infradead.org Git - users/hch/misc.git/commitdiff
wifi: cfg80211: update the time stamps in hidden ssid
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sun, 7 Sep 2025 08:51:43 +0000 (11:51 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 10 Sep 2025 13:04:59 +0000 (15:04 +0200)
In hidden SSID we have separate BSS entries for the beacon and for the
probe response(s).
The BSS entry time stamps represent the age of the BSS;
when was the last time we heard the BSS.
When we receive a beacon of a hidden SSID it means that we heard that
BSS, so it makes sense to indicate that in the probe response entries.
Do that.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250907115135.712745e498c0.I38186abf5d20dec6f6f2d42d2e1cdb50c6bfea25@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/scan.c

index a8339ed52404c6ba10fff58e6e4c59538ce5a480..52a3d32c16fe358decd67e84ac6cafe394eebda4 100644 (file)
@@ -1816,6 +1816,9 @@ static void cfg80211_update_hidden_bsses(struct cfg80211_internal_bss *known,
                WARN_ON(ies != old_ies);
 
                rcu_assign_pointer(bss->pub.beacon_ies, new_ies);
+
+               bss->ts = known->ts;
+               bss->pub.ts_boottime = known->pub.ts_boottime;
        }
 }
 
@@ -1882,6 +1885,10 @@ cfg80211_update_known_bss(struct cfg80211_registered_device *rdev,
 {
        lockdep_assert_held(&rdev->bss_lock);
 
+       /* Update time stamps */
+       known->ts = new->ts;
+       known->pub.ts_boottime = new->pub.ts_boottime;
+
        /* Update IEs */
        if (rcu_access_pointer(new->pub.proberesp_ies)) {
                const struct cfg80211_bss_ies *old;
@@ -1944,8 +1951,6 @@ cfg80211_update_known_bss(struct cfg80211_registered_device *rdev,
        if (signal_valid)
                known->pub.signal = new->pub.signal;
        known->pub.capability = new->pub.capability;
-       known->ts = new->ts;
-       known->pub.ts_boottime = new->pub.ts_boottime;
        known->parent_tsf = new->parent_tsf;
        known->pub.chains = new->pub.chains;
        memcpy(known->pub.chain_signal, new->pub.chain_signal,