aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-12-16 20:08:44 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-24 06:21:18 (GMT)
commita12d34546a4cf9800fb2bf679417b8cf25e6f420 (patch)
tree5cdfc80775595a8f286dae3519e411847cc0342e /wpa_supplicant/events.c
parent51bffab117ab1c0e7d02866a6911d9fbca09e98b (diff)
downloadhostap-a12d34546a4cf9800fb2bf679417b8cf25e6f420.zip
hostap-a12d34546a4cf9800fb2bf679417b8cf25e6f420.tar.gz
hostap-a12d34546a4cf9800fb2bf679417b8cf25e6f420.tar.bz2
wpa_supplicant: Use monotonic time for last_scan check
This just serves to check if there was a scan within the last 5 seconds, hence it should use monotonic time. While at it, also use os_reltime_expired(). Signed-hostap: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index fa5d681..eeb27e3 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1428,13 +1428,13 @@ int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s)
#ifdef CONFIG_NO_SCAN_PROCESSING
return -1;
#else /* CONFIG_NO_SCAN_PROCESSING */
- struct os_time now;
+ struct os_reltime now;
if (wpa_s->last_scan_res_used <= 0)
return -1;
- os_get_time(&now);
- if (now.sec - wpa_s->last_scan.sec > 5) {
+ os_get_reltime(&now);
+ if (os_reltime_expired(&now, &wpa_s->last_scan, 5)) {
wpa_printf(MSG_DEBUG, "Fast associate: Old scan results");
return -1;
}