[PATCH 1/1] STA: update scan results for ap_scan = 1 case also

Jithu Jance jithu
Tue Aug 5 23:45:40 PDT 2014


The commit 5cd4740580350371d77618ac037deef90b48d339 has rearranged
the update scan results code and hence the IEs were not getting
updated properly for ap_scan=1 case. This results in the 4 way
handshake failure in the roaming case (IE mismatch in 3/4 EAPOL).

Please see whether the patch is fine.

Signed-off-by: Jithu Jance <jithu at broadcom.com>
---
 wpa_supplicant/events.c |   28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 4e84f6e..6500069 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -86,7 +86,6 @@ static struct wpa_bss * wpa_supplicant_get_new_bss(
 static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s)
 {
 	struct wpa_ssid *ssid, *old_ssid;
-	struct wpa_bss *bss;
 	int res;

 	if (wpa_s->conf->ap_scan == 1 && wpa_s->current_ssid)
@@ -136,17 +135,6 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s)
 	old_ssid = wpa_s->current_ssid;
 	wpa_s->current_ssid = ssid;

-	bss = wpa_supplicant_get_new_bss(wpa_s, wpa_s->bssid);
-	if (!bss) {
-		wpa_supplicant_update_scan_results(wpa_s);
-
-		/* Get the BSS from the new scan results */
-		bss = wpa_supplicant_get_new_bss(wpa_s, wpa_s->bssid);
-	}
-
-	if (bss)
-		wpa_s->current_bss = bss;
-
 	wpa_supplicant_rsn_supp_set_config(wpa_s, wpa_s->current_ssid);
 	wpa_supplicant_initiate_eapol(wpa_s);
 	if (old_ssid != wpa_s->current_ssid)
@@ -1906,6 +1894,22 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
 		if (wpa_supplicant_dynamic_keys(wpa_s) && !ft_completed) {
 			wpa_clear_keys(wpa_s, bssid);
 		}
+
+		if (wpa_s->current_ssid) {
+			struct wpa_bss *bss = NULL;
+
+			bss = wpa_supplicant_get_new_bss(wpa_s, wpa_s->bssid);
+			if (!bss) {
+				wpa_supplicant_update_scan_results(wpa_s);
+
+				/* Get the BSS from the new scan results */
+				bss = wpa_supplicant_get_new_bss(wpa_s, wpa_s->bssid);
+			}
+
+			if (bss)
+				wpa_s->current_bss = bss;
+		}
+
 		if (wpa_supplicant_select_config(wpa_s) < 0) {
 			wpa_supplicant_deauthenticate(
 				wpa_s, WLAN_REASON_DEAUTH_LEAVING);
--
1.7.9.5




More information about the Hostap mailing list