]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Use monotonic time for SA query timeout
authorJohannes Berg <johannes.berg@intel.com>
Mon, 16 Dec 2013 20:08:27 +0000 (21:08 +0100)
committerJouni Malinen <j@w1.fi>
Tue, 24 Dec 2013 05:17:25 +0000 (07:17 +0200)
The SA query timeout is just a regular timeout (currently
hard-coded to 1000 TU), so use monotonic time for it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
wpa_supplicant/sme.c
wpa_supplicant/wpa_supplicant_i.h

index 87c14ae3e2fd1b01ca6d0e070dc0105adebee8a4..3a96623d4fc9053d70df28f060ef20d27f5095b7 100644 (file)
@@ -1151,9 +1151,9 @@ static const unsigned int sa_query_retry_timeout = 201;
 static int sme_check_sa_query_timeout(struct wpa_supplicant *wpa_s)
 {
        u32 tu;
-       struct os_time now, passed;
-       os_get_time(&now);
-       os_time_sub(&now, &wpa_s->sme.sa_query_start, &passed);
+       struct os_reltime now, passed;
+       os_get_reltime(&now);
+       os_reltime_sub(&now, &wpa_s->sme.sa_query_start, &passed);
        tu = (passed.sec * 1000000 + passed.usec) / 1024;
        if (sa_query_max_timeout < tu) {
                wpa_dbg(wpa_s, MSG_DEBUG, "SME: SA Query timed out");
@@ -1203,7 +1203,7 @@ static void sme_sa_query_timer(void *eloop_ctx, void *timeout_ctx)
                return;
        if (wpa_s->sme.sa_query_count == 0) {
                /* Starting a new SA Query procedure */
-               os_get_time(&wpa_s->sme.sa_query_start);
+               os_get_reltime(&wpa_s->sme.sa_query_start);
        }
        trans_id = nbuf + wpa_s->sme.sa_query_count * WLAN_SA_QUERY_TR_ID_LEN;
        wpa_s->sme.sa_query_trans_id = nbuf;
index 8cc813c8bfd6e9c1e8dbd340c7fb6ad57468da9a..d96d5e4cc7957455c83401a8724f9244d463ce84 100644 (file)
@@ -551,7 +551,7 @@ struct wpa_supplicant {
                u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
                                        * sa_query_count octets of pending
                                        * SA Query transaction identifiers */
-               struct os_time sa_query_start;
+               struct os_reltime sa_query_start;
                u8 sched_obss_scan;
                u16 obss_scan_int;
                u16 bss_max_idle_period;