]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Use monotonic time for EAPOL RX workaround
authorJohannes Berg <johannes.berg@intel.com>
Mon, 16 Dec 2013 20:08:33 +0000 (21:08 +0100)
committerJouni Malinen <j@w1.fi>
Tue, 24 Dec 2013 05:35:42 +0000 (07:35 +0200)
The EAPOL RX workaround checks that the events are less than 100 ms
apart, so only uses relative times and should use monotonic time.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 517d812f04690b8c6ca7ceb94697e794e174fcd5..21a11323c8217a3a7a3394651865b995b138b170 100644 (file)
@@ -1951,9 +1951,9 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
        wpa_s->last_eapol_matches_bssid = 0;
 
        if (wpa_s->pending_eapol_rx) {
-               struct os_time now, age;
-               os_get_time(&now);
-               os_time_sub(&now, &wpa_s->pending_eapol_rx_time, &age);
+               struct os_reltime now, age;
+               os_get_reltime(&now);
+               os_reltime_sub(&now, &wpa_s->pending_eapol_rx_time, &age);
                if (age.sec == 0 && age.usec < 100000 &&
                    os_memcmp(wpa_s->pending_eapol_rx_src, bssid, ETH_ALEN) ==
                    0) {
index 6390d130c88dfe22c5e9b3d9e667e3e8a0ce0709..f93d71800dbe4e35ae7bd82547854008566e0a4e 100644 (file)
@@ -2349,7 +2349,7 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
                wpabuf_free(wpa_s->pending_eapol_rx);
                wpa_s->pending_eapol_rx = wpabuf_alloc_copy(buf, len);
                if (wpa_s->pending_eapol_rx) {
-                       os_get_time(&wpa_s->pending_eapol_rx_time);
+                       os_get_reltime(&wpa_s->pending_eapol_rx_time);
                        os_memcpy(wpa_s->pending_eapol_rx_src, src_addr,
                                  ETH_ALEN);
                }
index 3acb86519951cf1d4b1500b9a440e1fc3894b117..769e3530216d360bfcaf7e9b7ab785032d1f20a2 100644 (file)
@@ -517,7 +517,7 @@ struct wpa_supplicant {
        int blacklist_cleared;
 
        struct wpabuf *pending_eapol_rx;
-       struct os_time pending_eapol_rx_time;
+       struct os_reltime pending_eapol_rx_time;
        u8 pending_eapol_rx_src[ETH_ALEN];
        unsigned int last_eapol_matches_bssid:1;