From patchwork Tue Aug 4 22:42:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: pasi.sjoholm@jolla.com X-Patchwork-Id: 503841 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 0103914031B for ; Wed, 5 Aug 2015 08:42:51 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 1F2D09D24F; Tue, 4 Aug 2015 18:42:49 -0400 (EDT) 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 xOz1RRxE+gT3; Tue, 4 Aug 2015 18:42:48 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id C5CA29D257; Tue, 4 Aug 2015 18:42:43 -0400 (EDT) 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 12C5417C0B2 for ; Tue, 4 Aug 2015 18:42:42 -0400 (EDT) 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 PTQ7AXLFVzoh for ; Tue, 4 Aug 2015 18:42:41 -0400 (EDT) Received: from smtp144.dfw.emailsrvr.com (smtp144.dfw.emailsrvr.com [67.192.241.144]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id E07DF17C06C for ; Tue, 4 Aug 2015 18:42:41 -0400 (EDT) Received: from smtp31.relay.dfw1a.emailsrvr.com (localhost.localdomain [127.0.0.1]) by smtp31.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 5DD7038029B for ; Tue, 4 Aug 2015 18:42:41 -0400 (EDT) Received: by smtp31.relay.dfw1a.emailsrvr.com (Authenticated sender: pasi.sjoholm-AT-jollamobile.com) with ESMTPSA id 06345380188 for ; Tue, 4 Aug 2015 18:42:40 -0400 (EDT) X-Sender-Id: pasi.sjoholm@jollamobile.com Received: from localhost.localdomain (host-109-204-154-53.tp-fne.tampereenpuhelin.net [109.204.154.53]) (using TLSv1.2 with cipher AES128-SHA256) by 0.0.0.0:587 (trex/5.4.2); Tue, 04 Aug 2015 22:42:41 GMT From: pasi.sjoholm@jolla.com To: hostap@lists.shmoo.com Subject: [PATCH] Do not retry scan after failure if operating in ap_mode Date: Wed, 5 Aug 2015 01:42:35 +0300 Message-Id: <1438728155-26987-1-git-send-email-pasi.sjoholm@jolla.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 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: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Pasi Sjöholm Commit 2d9c99e37b29a639dafa431df38e1586a31ba887 introduced a regression while running in ap_mode together with ap_scan configured with value of 2. Retrying caused following path to be called: wpa_supplicant_req_scan()->wpa_supplicant_scan()-> wpa_supplicant_assoc_try()->wpa_supplicant_associate()-> wpa_supplicant_create_ap() Which eventually teared down the currently configured ap_mode by calling wpa_supplicant_ap_deinit(). Signed-off-by: Pasi Sjöholm --- wpa_supplicant/scan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 8d0d1a5..cb42456 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -186,6 +186,9 @@ static void wpas_trigger_scan_cb(struct wpa_radio_work *work, int deinit) if (wpa_s->disconnected) retry = 0; + if (wpa_s->last_ssid && wpa_s->last_ssid->mode == WPAS_MODE_AP) + retry = 0; + wpa_supplicant_notify_scanning(wpa_s, 0); wpas_notify_scan_done(wpa_s, 0); if (wpa_s->wpa_state == WPA_SCANNING)