mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
Merge branch 'bugfix/wps_deauth_during_scan_v5.2' into 'release/v5.2'
fix(wifi): ignore disconnect events outside WPS handshake phase in wps (v5.2) See merge request espressif/esp-idf!47252
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2019-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -913,6 +913,16 @@ static void wps_sm_notify_deauth(void)
|
||||
{
|
||||
if (gWpsSm && gWpsSm->wps->state != WPS_FINISHED &&
|
||||
!gWpsSm->intermediate_disconnect) {
|
||||
/* wifi_station_wps_start() calls esp_wifi_disconnect() to leave the
|
||||
* previously connected AP before scanning. That synchronous disconnect
|
||||
* callback must not be treated as a WPS handshake failure. Only act
|
||||
* on deauths received while actually negotiating (STATUS_PENDING). */
|
||||
if (wps_get_status() != WPS_STATUS_PENDING) {
|
||||
wpa_printf(MSG_DEBUG, "WPS: Ignoring disconnect, not in WPS-handshake phase (status=%d)",
|
||||
wps_get_status());
|
||||
return;
|
||||
}
|
||||
wpa_printf(MSG_ERROR, "WPS: Deauthenticated during handshake");
|
||||
wps_stop_process(WPS_FAIL_REASON_RECV_DEAUTH);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user