From patchwork Fri Oct 27 22:31:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wang X-Patchwork-Id: 831590 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cxQUcjeg"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPD182dh5z9t2R for ; Sat, 28 Oct 2017 19:09:32 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:Message-Id:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ljP08I28kcZgvoYkRr5ds/wF3WnMYGVUuE2HgpnEL6E=; b=cxQUcjegDfihST 0+2EqZN8LyBVkEAKdVZRouiNTE0VHaXp27b3pKyoYnscgl87RbFQkngMjtA3yPuFIDgIwrG4A5Ueq iv8kQD+QsOna+dFIAsG3XSmpMclHY4NaNvjEvEYjKH5U7h9x0jQDZNcua3XfOD0bh94Q7JG9kA45u tzWcbxS/DtVinbWEtV6Y/6QDXAWmUB+v4TijBPXK/qG8deY3/RqwRqIwAREBAz2cfTm0cjZPWtFm+ lc16KLy3s+iNYp3YM9U7LeB31PTglqm7qirpiJuriRPBIc5lDWp+grWtzMMnVsdrZK6mrZFXBanhg 6OXlpQ/YxKLCeGCxnGuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e8MBN-0001k4-Pp; Sat, 28 Oct 2017 08:09:29 +0000 Received: from mail-qk0-f201.google.com ([209.85.220.201]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e8DAJ-00074L-K3 for hostap@lists.infradead.org; Fri, 27 Oct 2017 22:31:53 +0000 Received: by mail-qk0-f201.google.com with SMTP id g74so6057931qke.4 for ; Fri, 27 Oct 2017 15:31:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc; bh=RowmP8u5XUw4m5G0tGv5phkC1lox4zwGMxOpGAT4xD0=; b=a2ioDp1ApGO+JDzLbxd+LQtC2wEqvuRZ2VuWiBwfu2BVNwlCC9GfrBKy7hNz8Cqmpn ODTbyrXMew1pLu8FL+ZDJYLocenwzw8COY2A7Wuqx8p6BnNtCBexS51C42jgn0AEbIQm RpoiZ1EIkix22FqR9INSxHuA8xROAvCsF00SFk3EoFpq+dElv6Slv1Q8OPJTJWDz/5uJ fMUzp0qIkViCZmjnTJAVSZgsI/9SrnuG61pkrYhIL4jfFIcDvWCbLmeVqu3k30c7QXxF uBexDypCXK+eMqJ9a2ifan1quJRuyfvI13Eg/4FvP17BWjni8Bx+CF1Yj/l7VlY5hGu0 wTLQ== X-Gm-Message-State: AMCzsaVHeiRD+lZX2wizmHeOUYzSSxwuaV3Qtk6WUAazQD8g4zW1DZ2w ly7aAyZMAZiwldfUOImYdd6X/RJdPQZNpuG3XTg= X-Google-Smtp-Source: ABhQp+QYJp2GS8haxr48QCC5yAU95aDHzJGqkFHlExI8DFqtj+nEb71A76eps0gjk3NlD56ChWwDAUUAdob78QLPeyY= MIME-Version: 1.0 X-Received: by 10.55.158.86 with SMTP id h83mr7698729qke.6.1509143485584; Fri, 27 Oct 2017 15:31:25 -0700 (PDT) Date: Fri, 27 Oct 2017 15:31:11 -0700 Message-Id: <20171027223111.127932-1-matthewmwang@chromium.org> X-Mailer: git-send-email 2.15.0.rc2.357.g7e34df9404-goog Subject: [PATCH RESEND] CHROMIUM: wpa_supplicant: Full-scan after blacklisting From: Matthew Wang To: j@w1.fi X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171027_153147_990356_00A2A7C2 X-CRM114-Status: GOOD ( 10.39 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.220.201 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.220.201 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -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-Mailman-Approved-At: Sat, 28 Oct 2017 01:09:06 -0700 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hostap@lists.infradead.org, Kirtika Ruchandani Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Kirtika Ruchandani Current behavior of wpa_supplicant, when an AP deauths us is to blacklist the AP, followed by restricting the next scan to only frequencies where APs from the recently disconnected AP's BSS have been seen. This can be problematic, since it assumes that our knowledge of the channels/frequencies where APs from this BSS are running is fresh. If the APs have moved to better/less-populated channels since our last scan, we'll miss them on the next scan. This change adds a config to disable the scan restriction to previously seen frequencies. Sample situation from field reports - AP 1 from BSS 'foo' we're connected to, deauths us to move to a better channel. Our last scan showed BSS 'foo' has APs at frequencies f1, f2, f3, and f4. If AP1 jumped channels, it is likely that the other APs at f2, f3 jumped channels as well. We will not find these APs and will connect to a worse AP than we should have. --- wpa_supplicant/Android.mk | 4 ++++ wpa_supplicant/Makefile | 4 ++++ wpa_supplicant/android.config | 4 ++++ wpa_supplicant/defconfig | 4 ++++ wpa_supplicant/wpa_supplicant.c | 2 ++ 5 files changed, 18 insertions(+) Resending to correct formatting and authorship. diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk index 1faff2ecd..8e7880442 100644 --- a/wpa_supplicant/Android.mk +++ b/wpa_supplicant/Android.mk @@ -32,6 +32,10 @@ ifeq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),) L_CFLAGS += -DANDROID_LIB_STUB endif +ifdef CONFIG_SCAN_KNOWN_CHANNELS_ONLY +L_CFLAGS += -DCONFIG_SCAN_KNOWN_CHANNELS_ONLY +endif + # Disable roaming in wpa_supplicant ifdef CONFIG_NO_ROAMING L_CFLAGS += -DCONFIG_NO_ROAMING diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile index 65205d8eb..576da5faf 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -408,6 +408,10 @@ CFLAGS += -DCONFIG_INTERWORKING NEED_GAS=y endif +ifdef CONFIG_SCAN_KNOWN_CHANNELS_ONLY +CFLAGS += -DCONFIG_SCAN_KNOWN_CHANNELS_ONLY +endif + ifdef CONFIG_NO_ROAMING CFLAGS += -DCONFIG_NO_ROAMING endif diff --git a/wpa_supplicant/android.config b/wpa_supplicant/android.config index a4b17b055..1a8738a10 100644 --- a/wpa_supplicant/android.config +++ b/wpa_supplicant/android.config @@ -467,6 +467,10 @@ CONFIG_HS20=y # Enable interface matching in wpa_supplicant #CONFIG_MATCH_IFACE=y +# Scan only the known channels used in the current ESS based on the previous +# scans. +CONFIG_SCAN_KNOWN_CHANNELS_ONLY=y + # Disable roaming in wpa_supplicant CONFIG_NO_ROAMING=y diff --git a/wpa_supplicant/defconfig b/wpa_supplicant/defconfig index 450023e7a..9b5b1cc75 100644 --- a/wpa_supplicant/defconfig +++ b/wpa_supplicant/defconfig @@ -476,6 +476,10 @@ CONFIG_BACKEND=file # Enable interface matching in wpa_supplicant #CONFIG_MATCH_IFACE=y +# Scan only the known channels used in the current ESS based on the previous +# scans. +CONFIG_SCAN_KNOWN_CHANNELS_ONLY=y + # Disable roaming in wpa_supplicant #CONFIG_NO_ROAMING=y diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index eb45627b3..8603dbb41 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -6277,6 +6277,7 @@ void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid) wpa_dbg(wpa_s, MSG_DEBUG, "Another BSS in this ESS " "has been seen; try it next"); wpa_blacklist_add(wpa_s, bssid); +#ifdef CONFIG_SCAN_KNOWN_CHANNELS_ONLY /* * On the next scan, go through only the known channels * used in this ESS based on previous scans to speed up @@ -6284,6 +6285,7 @@ void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid) */ os_free(wpa_s->next_scan_freqs); wpa_s->next_scan_freqs = freqs; +#endif /* CONFIG_SCAN_KNOWN_CHANNELS_ONLY */ } }