WPS: Use monotonic time for AP connection attempt

This is only used for a debug message, but that message prints
the time since the last attempt, so it should use monotonic
time instead of wall clock.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2013-12-16 21:08:43 +01:00 committed by Jouni Malinen
parent 6473e5c842
commit 51bffab117
2 changed files with 4 additions and 4 deletions

View file

@ -302,7 +302,7 @@ struct wps_ap_info {
WPS_AP_SEL_REG_OUR WPS_AP_SEL_REG_OUR
} type; } type;
unsigned int tries; unsigned int tries;
struct os_time last_attempt; struct os_reltime last_attempt;
}; };
struct wpa_ssid_value { struct wpa_ssid_value {

View file

@ -2360,7 +2360,7 @@ extern int wpa_debug_level;
static void wpas_wps_dump_ap_info(struct wpa_supplicant *wpa_s) static void wpas_wps_dump_ap_info(struct wpa_supplicant *wpa_s)
{ {
size_t i; size_t i;
struct os_time now; struct os_reltime now;
if (wpa_debug_level > MSG_DEBUG) if (wpa_debug_level > MSG_DEBUG)
return; return;
@ -2368,7 +2368,7 @@ static void wpas_wps_dump_ap_info(struct wpa_supplicant *wpa_s)
if (wpa_s->wps_ap == NULL) if (wpa_s->wps_ap == NULL)
return; return;
os_get_time(&now); os_get_reltime(&now);
for (i = 0; i < wpa_s->num_wps_ap; i++) { for (i = 0; i < wpa_s->num_wps_ap; i++) {
struct wps_ap_info *ap = &wpa_s->wps_ap[i]; struct wps_ap_info *ap = &wpa_s->wps_ap[i];
@ -2481,5 +2481,5 @@ void wpas_wps_notify_assoc(struct wpa_supplicant *wpa_s, const u8 *bssid)
if (ap == NULL) if (ap == NULL)
return; return;
ap->tries++; ap->tries++;
os_get_time(&ap->last_attempt); os_get_reltime(&ap->last_attempt);
} }