From 016643417f5df52e91eed9bf9c13009c467bec41 Mon Sep 17 00:00:00 2001 From: Sarvesh Bodakhe Date: Sun, 8 Mar 2026 12:50:06 +0530 Subject: [PATCH] fix(wps): Do not disconnect on WPS success in esp_wifi_wps_disable When WPS succeeds, wps_finish() already handles disconnect, reconfigure, and reconnect with the obtained credentials. The subsequent 4-way handshake starts immediately. However, esp_wifi_wps_disable() (called from the user's WPS success event handler) was also disconnecting when status was WPS_STATUS_SUCCESS, killing the in-progress 4-way handshake. Only disconnect in esp_wifi_wps_disable() when status is WPS_STATUS_PENDING (i.e., WPS exchange was cancelled mid-way), matching the behavior on master. --- components/wpa_supplicant/esp_supplicant/src/esp_wps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index 8221deedbc..0debd352b1 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -2044,8 +2044,8 @@ int esp_wifi_wps_disable(void) wpa_printf(MSG_ERROR, "wps disable: failed to disable wps, ret=%d", ret); } - /* Only disconnect in case of WPS pending/done */ - if ((wps_status == WPS_STATUS_PENDING) || (wps_status == WPS_STATUS_SUCCESS)) { + /* Only disconnect in case of WPS pending */ + if (wps_status == WPS_STATUS_PENDING) { esp_wifi_disconnect(); } esp_wifi_set_wps_start_flag_internal(false);