mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-10 00:42:48 +00:00
fix(esp_wifi): Backport some wifi fixes
1. Fix memory leak caused by assoc IE and retry timer
2. Discard commit frame received at confirmed state in SAE
3. Ignore immediate assoc req received from the station while we are
processing the older one. Fix regression caused by 4cb4faa9
This commit is contained in:
@@ -559,7 +559,7 @@ int handle_auth_sae(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
}
|
||||
|
||||
if (sae_check_confirm(sta->sae, buf, len) < 0) {
|
||||
resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
resp = WLAN_STATUS_CHALLENGE_FAIL;
|
||||
goto reply;
|
||||
}
|
||||
sta->sae->rc = peer_send_confirm;
|
||||
@@ -569,7 +569,6 @@ int handle_auth_sae(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
} else {
|
||||
wpa_printf(MSG_ERROR, "unexpected SAE authentication transaction %u (status=%u )", auth_transaction, status);
|
||||
if (status != WLAN_STATUS_SUCCESS) {
|
||||
resp = -1;
|
||||
goto remove_sta;
|
||||
}
|
||||
resp = WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION;
|
||||
|
@@ -175,7 +175,6 @@ struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr)
|
||||
#ifdef CONFIG_SAE
|
||||
sta->sae_commit_processing = false;
|
||||
sta->remove_pending = false;
|
||||
sta->lock = os_semphr_create(1, 1);
|
||||
#endif /* CONFIG_SAE */
|
||||
|
||||
return sta;
|
||||
|
@@ -488,6 +488,7 @@ static void wpa_free_sta_sm(struct wpa_state_machine *sm)
|
||||
wpa_printf( MSG_DEBUG, "wpa_free_sta_sm: free eapol=%p\n", sm->last_rx_eapol_key);
|
||||
os_free(sm->last_rx_eapol_key);
|
||||
os_free(sm->wpa_ie);
|
||||
os_free(sm->rsnxe);
|
||||
os_free(sm);
|
||||
}
|
||||
|
||||
@@ -2635,7 +2636,7 @@ bool wpa_ap_remove(u8* bssid)
|
||||
} else {
|
||||
sta->remove_pending = true;
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
#endif /* CONFIG_SAE */
|
||||
|
||||
@@ -2644,10 +2645,10 @@ bool wpa_ap_remove(u8* bssid)
|
||||
if (wps_get_status() == WPS_STATUS_PENDING) {
|
||||
u8 *addr = os_malloc(ETH_ALEN);
|
||||
|
||||
if (!addr) {
|
||||
if (!addr) {
|
||||
return false;
|
||||
}
|
||||
os_memcpy(addr, sta->addr, ETH_ALEN);
|
||||
}
|
||||
os_memcpy(addr, sta->addr, ETH_ALEN);
|
||||
eloop_register_timeout(0, 10000, ap_free_sta_timeout, hapd, addr);
|
||||
} else
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user