mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-21 08:49:25 +00:00
fix(esp_wifi): Populate appropriate reason codes when softAP sends deauthentication
Populate appropriate reason for sending deauthentication when softAP receives invalid RSN IE from association request
This commit is contained in:
@@ -356,6 +356,7 @@ static bool hostap_sta_join(void **sta, u8 *bssid, u8 *wpa_ie, u8 wpa_ie_len, u8
|
||||
{
|
||||
struct sta_info *sta_info = NULL;
|
||||
struct hostapd_data *hapd = hostapd_get_hapd_data();
|
||||
uint8_t reason = WLAN_REASON_PREV_AUTH_NOT_VALID;
|
||||
|
||||
if (!hapd) {
|
||||
goto fail;
|
||||
@@ -413,7 +414,7 @@ process_old_sta:
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
if (wpa_ap_join(sta_info, bssid, wpa_ie, wpa_ie_len, rsnxe, rsnxe_len, pmf_enable, subtype, pairwise_cipher)) {
|
||||
if (hostap_new_assoc_sta(sta_info, bssid, wpa_ie, wpa_ie_len, rsnxe, rsnxe_len, pmf_enable, subtype, pairwise_cipher, &reason)) {
|
||||
goto done;
|
||||
} else {
|
||||
goto fail;
|
||||
@@ -434,7 +435,7 @@ fail:
|
||||
os_semphr_give(sta_info->lock);
|
||||
}
|
||||
#endif /* CONFIG_SAE */
|
||||
esp_wifi_ap_deauth_internal(bssid, WLAN_REASON_PREV_AUTH_NOT_VALID);
|
||||
esp_wifi_ap_deauth_internal(bssid, reason);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user