aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2020-01-03 16:06:01 (GMT)
committerJouni Malinen <j@w1.fi>2020-01-03 16:06:01 (GMT)
commitaf670cb418dc836ef96cee88027144777a1f3e6f (patch)
treedab5bba2ef1318b8e1cf9f16ad5af5705da334f7
parentecd54bace4954b9d2a25d8fb49a8c7f1aed8004f (diff)
downloadhostap-af670cb418dc836ef96cee88027144777a1f3e6f.zip
hostap-af670cb418dc836ef96cee88027144777a1f3e6f.tar.gz
hostap-af670cb418dc836ef96cee88027144777a1f3e6f.tar.bz2
SME: Postpone current BSSID clearing until IEs are prepared
sme_send_authentication() could fail before actually requesting the driver to authenticate with a new AP. This could happen after wpa_s->bssid got cleared even though in such a case, the old association is maintained and still valid. This can result in unexpected behavior since wpa_s->bssid would not match the current BSSID anymore. Fix this by postponing clearing of wpa_s->bssid until the IE preparation has been completed successfully. Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--wpa_supplicant/sme.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 08d7e3e..2d7373e 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -372,12 +372,6 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
}
params.wep_tx_keyidx = ssid->wep_tx_keyidx;
- bssid_changed = !is_zero_ether_addr(wpa_s->bssid);
- os_memset(wpa_s->bssid, 0, ETH_ALEN);
- os_memcpy(wpa_s->pending_bssid, bss->bssid, ETH_ALEN);
- if (bssid_changed)
- wpas_notify_bssid_changed(wpa_s);
-
if ((wpa_bss_get_vendor_ie(bss, WPA_IE_VENDOR_TYPE) ||
wpa_bss_get_ie(bss, WLAN_EID_RSN)) &&
wpa_key_mgmt_wpa(ssid->key_mgmt)) {
@@ -718,6 +712,12 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
}
#endif /* CONFIG_SAE */
+ bssid_changed = !is_zero_ether_addr(wpa_s->bssid);
+ os_memset(wpa_s->bssid, 0, ETH_ALEN);
+ os_memcpy(wpa_s->pending_bssid, bss->bssid, ETH_ALEN);
+ if (bssid_changed)
+ wpas_notify_bssid_changed(wpa_s);
+
old_ssid = wpa_s->current_ssid;
wpa_s->current_ssid = ssid;
wpa_supplicant_rsn_supp_set_config(wpa_s, wpa_s->current_ssid);