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

Jouni Malinen j at w1.fi
Tue Aug 12 09:59:33 EDT 2014


On Wed, Aug 06, 2014 at 12:15:40PM +0530, Jithu Jance wrote:
> 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.

Hmm.. This seems to move the wpa_s->current_bss update to happen before
wpa_supplicant_select_config() has a chance to confirm that the selected
BSS is acceptable. This does not look desirable.

What is the key difference for IE mismatch? Updating wpa_s->current_bss
or the call to wpa_supplicant_update_scan_results()? I'd assume it is
the latter. In either case, I'd expect something like this to be a safer
change:

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 4e84f6e..db763a4 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -89,8 +89,20 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s)
 	struct wpa_bss *bss;
 	int res;
 
-	if (wpa_s->conf->ap_scan == 1 && wpa_s->current_ssid)
+	if (wpa_s->conf->ap_scan == 1 && wpa_s->current_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;
+
 		return 0;
+	}
 
 	wpa_dbg(wpa_s, MSG_DEBUG, "Select network based on association "
 		"information");
 
-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list