From patchwork Mon Dec 16 20:08:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 301833 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0297D2C007C for ; Tue, 17 Dec 2013 07:14:20 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4AD1D17C065; Mon, 16 Dec 2013 15:14:17 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nf-ElL3CGJFH; Mon, 16 Dec 2013 15:14:17 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 77E2A9D4A0; Mon, 16 Dec 2013 15:11:39 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B444817C066 for ; Mon, 16 Dec 2013 15:11:38 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xWq5d8LsRnI5 for ; Mon, 16 Dec 2013 15:11:33 -0500 (EST) Received: from sipsolutions.net (s3.sipsolutions.net [144.76.43.152]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 3853C9D498 for ; Mon, 16 Dec 2013 15:09:41 -0500 (EST) Received: by sipsolutions.net with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1VseTK-0001Wv-4m; Mon, 16 Dec 2013 21:08:58 +0100 From: Johannes Berg To: hostap@lists.shmoo.com Subject: [PATCH 22/23] wps_supplicant: use monotonic time for AP connection attempt Date: Mon, 16 Dec 2013 21:08:43 +0100 Message-Id: <1387224524-17441-23-git-send-email-johannes@sipsolutions.net> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1387224524-17441-1-git-send-email-johannes@sipsolutions.net> References: <1387224524-17441-1-git-send-email-johannes@sipsolutions.net> Cc: Johannes Berg X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Johannes Berg 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 --- wpa_supplicant/wpa_supplicant_i.h | 2 +- wpa_supplicant/wps_supplicant.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 8612271..663f7fd 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -302,7 +302,7 @@ struct wps_ap_info { WPS_AP_SEL_REG_OUR } type; unsigned int tries; - struct os_time last_attempt; + struct os_reltime last_attempt; }; struct wpa_ssid_value { diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index 0b3c892..4db963c 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -2360,7 +2360,7 @@ extern int wpa_debug_level; static void wpas_wps_dump_ap_info(struct wpa_supplicant *wpa_s) { size_t i; - struct os_time now; + struct os_reltime now; if (wpa_debug_level > MSG_DEBUG) return; @@ -2368,7 +2368,7 @@ static void wpas_wps_dump_ap_info(struct wpa_supplicant *wpa_s) if (wpa_s->wps_ap == NULL) return; - os_get_time(&now); + os_get_reltime(&now); for (i = 0; i < wpa_s->num_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) return; ap->tries++; - os_get_time(&ap->last_attempt); + os_get_reltime(&ap->last_attempt); }