From patchwork Thu Dec 10 10:56:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peer, Ilan" X-Patchwork-Id: 555086 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 209B8140C27 for ; Thu, 10 Dec 2015 20:14:01 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6xIP-0006lQ-3b; Thu, 10 Dec 2015 09:13:53 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6xGK-0004ZV-5G for hostap@bombadil.infradead.org; Thu, 10 Dec 2015 09:11:44 +0000 Received: from mga11.intel.com ([192.55.52.93]) by casper.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6bUE-0002k3-8w for hostap@lists.infradead.org; Wed, 09 Dec 2015 09:56:38 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 10 Dec 2015 00:59:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,407,1444719600"; d="scan'208";a="838310226" Received: from unknown (HELO JED00377.ger.corp.intel.com) ([10.12.217.192]) by orsmga001.jf.intel.com with ESMTP; 10 Dec 2015 00:59:01 -0800 From: Ilan Peer To: hostap@lists.infradead.org Subject: [PATCH 3/8] wpa_supplicant: Avoid net-select from scan during connection Date: Thu, 10 Dec 2015 12:56:04 +0200 Message-Id: <1449744969-14895-3-git-send-email-ilan.peer@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449744969-14895-1-git-send-email-ilan.peer@intel.com> References: <1449744969-14895-1-git-send-email-ilan.peer@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151209_095638_443115_39D00448 X-CRM114-Status: UNSURE ( 9.99 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.0 on casper.infradead.org summary: Content analysis details: (-6.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [192.55.52.93 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.55.52.93 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arik Nemtsov , Arik Nemtsov MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Arik Nemtsov If scan-results arrive during the connection process, the network selection function will be called, interrupting the current connection. While regular-scan is mutually exclusive with connection-establishment via the nature of radio-work, there's no such protection for sched-scan. Prevent network-selection while a connection is in progress. Signed-off-by: Arik Nemtsov --- wpa_supplicant/events.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 3ca4c3f..a7b053d 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1518,6 +1518,10 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s, wpas_wps_update_ap_info(wpa_s, scan_res); + if (wpa_s->wpa_state >= WPA_AUTHENTICATING && + wpa_s->wpa_state < WPA_COMPLETED) + goto scan_work_done; + wpa_scan_results_free(scan_res); if (own_request && wpa_s->scan_work) {