diff options
author | Thomas Haller <thaller@redhat.com> | 2020-04-30 09:54:23 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-04-30 10:06:55 +0200 |
commit | a0e115cb44cdc4bd7dc0e3c32ccb2d4bb6478d2e (patch) | |
tree | e11e61a10212409c40b69d37438ad79d1efe6e8e | |
parent | 8fb22411833fb2fbe1e0365a6e69e93d6db3c0ad (diff) | |
download | NetworkManager-a0e115cb44cdc4bd7dc0e3c32ccb2d4bb6478d2e.tar.gz |
wifi: pass now_msec to _scan_request_ssids_fetch()
We make decisions based on the timestamp. We should only fetch the timestamp
once, and make consistent decisions about that. Don't read different timestamps.
-rw-r--r-- | src/devices/wifi/nm-device-wifi.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index 6d00e300bf..af12f6b223 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -269,13 +269,13 @@ _scan_request_ssids_remove_all (NMDeviceWifiPrivate *priv, } static GPtrArray * -_scan_request_ssids_fetch (NMDeviceWifiPrivate *priv) +_scan_request_ssids_fetch (NMDeviceWifiPrivate *priv, gint64 now_msec) { ScanRequestSsidData *srs_data; GPtrArray *ssids; guint len; - _scan_request_ssids_remove_all (priv, nm_utils_get_monotonic_timestamp_msec (), SCAN_REQUEST_SSIDS_MAX_NUM); + _scan_request_ssids_remove_all (priv, now_msec, SCAN_REQUEST_SSIDS_MAX_NUM); len = nm_g_hash_table_size (priv->scan_request_ssids_hash); nm_assert (len == c_list_length (&priv->scan_request_ssids_lst_head)); @@ -1531,6 +1531,7 @@ hidden_filter_func (NMSettings *settings, static GPtrArray * _scan_request_ssids_build_hidden (NMDeviceWifi *self, + gint64 now_msec, gboolean *out_has_hidden_profiles) { NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); @@ -1545,7 +1546,7 @@ _scan_request_ssids_build_hidden (NMDeviceWifi *self, NM_SET_OUT (out_has_hidden_profiles, FALSE); /* collect all pending explicit SSIDs. */ - ssids = _scan_request_ssids_fetch (priv); + ssids = _scan_request_ssids_fetch (priv, now_msec); if (max_scan_ssids == 0) { /* no space. @ssids will be ignored. */ @@ -1764,7 +1765,7 @@ _scan_kickoff (NMDeviceWifi *self) priv->scan_periodic_next_msec = now_msec + 1000 * priv->scan_periodic_interval_sec; } - ssids = _scan_request_ssids_build_hidden (self, &has_hidden_profiles); + ssids = _scan_request_ssids_build_hidden (self, now_msec, &has_hidden_profiles); if (has_hidden_profiles) { if (priv->hidden_probe_scan_warn) { priv->hidden_probe_scan_warn = FALSE; |