From 4d3be9cdd1437e11dcea3182f85cdc9c65113cd5 Mon Sep 17 00:00:00 2001 From: Sunil Dutt Date: Thu, 28 May 2015 20:41:12 +0530 Subject: [PATCH] Postpone updating of wpa_s->current_bss till association event In the case of driver-based BSS selection, a bssid_hint in the connect request might not result in to the selection of the same BSS. Thus, postpone the updation of the wpa_s->current_bss till the association event is received unless the BSSID is forced. This fixes issues where wpa_s->current_bss may end up being updated to point to the BSS that wpa_supplicant provided as a hint for a roaming case, but then not restored if the driver decides to "return" to the current BSS instead. This could result in some operations (e.g., WNM BSS TM response) not working properly due to incorrect BSS being identified in wpa_s->current_bss. Signed-off-by: Jouni Malinen --- wpa_supplicant/wpa_supplicant.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 874eb48..48bded6 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2400,7 +2400,8 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit) } old_ssid = wpa_s->current_ssid; wpa_s->current_ssid = ssid; - wpa_s->current_bss = bss; + if (!wpas_driver_bss_selection(wpa_s) || ssid->bssid_set) + 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) -- 2.1.4