[RESEND] CHROMIUM: wpa_supplicant: Full-scan after blacklisting

Message ID 20171027223111.127932-1-matthewmwang@chromium.org
State New
Headers show
Series
  • [RESEND] CHROMIUM: wpa_supplicant: Full-scan after blacklisting
Related show

Commit Message

Matthew Wang Oct. 27, 2017, 10:31 p.m.
From: Kirtika Ruchandani <kirtika@chromium.org>

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.

Patch

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 */
 		}
 	}