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:
Shyamal Khachane
2024-05-07 15:49:46 +05:30
committed by jack
parent 6797c86135
commit 624878b6e2
5 changed files with 151 additions and 97 deletions

View File

@@ -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