diff mbox

[1/3] wpa_supplicant: Don't optimize scan frequencies if selected network has changed

Message ID 1426483203-7325-1-git-send-email-ilan.peer@intel.com
State Accepted
Headers show

Commit Message

Peer, Ilan March 16, 2015, 5:20 a.m. UTC
From: Avraham Stern <avraham.stern@intel.com>

When disconnecting from a BSS, the next scan is optimized to scan only
the channels used by the connected ESS. But when disconnecting because
a new network was selected, this optimization is wrong because
wpa_supplicant is now trying to connect to another ESS.
Fix this by not optimizing the scan frequencies in case the selected
network has changed.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
---
 wpa_supplicant/wpa_supplicant.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Jouni Malinen March 22, 2015, 8:12 p.m. UTC | #1
On Mon, Mar 16, 2015 at 01:20:01AM -0400, Ilan Peer wrote:
> When disconnecting from a BSS, the next scan is optimized to scan only
> the channels used by the connected ESS. But when disconnecting because
> a new network was selected, this optimization is wrong because
> wpa_supplicant is now trying to connect to another ESS.
> Fix this by not optimizing the scan frequencies in case the selected
> network has changed.

Thanks, applied.
diff mbox

Patch

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 19fb890..6e3b907 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2625,6 +2625,13 @@  void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
 		eapol_sm_notify_config(wpa_s->eapol, NULL, NULL);
 		wpa_s->connect_without_scan =
 			(ssid->mode == WPAS_MODE_MESH) ? ssid : NULL;
+
+		/*
+		 * Don't optimize next scan freqs since a new ESS has been
+		 * selected.
+		 */
+		os_free(wpa_s->next_scan_freqs);
+		wpa_s->next_scan_freqs = NULL;
 	} else {
 		wpa_s->connect_without_scan = NULL;
 	}