Merge branch 'bugfix/wps_finish_bug' into 'master'

fix(esp_wifi): Fix bug where wps_finish is called recursively

Closes WIFIBUG-1520 and WIFIBUG-1675

See merge request espressif/esp-idf!45287
This commit is contained in:
Jiang Jiang Jian
2026-02-05 10:32:45 +08:00
2 changed files with 5 additions and 0 deletions
@@ -681,6 +681,10 @@ static int wps_finish(void)
}
if (sm->wps->state == WPS_FINISHED) {
if (sm->state == WPA_FINISH_PROCESS) {
return ESP_OK;
}
sm->state = WPA_FINISH_PROCESS;
bool connect = (sm->ap_cred_cnt == 1);
#ifdef CONFIG_WPS_RECONNECT_ON_FAIL
@@ -31,6 +31,7 @@ typedef struct {
enum wps_sm_state {
WAIT_START,
WPA_MESG,
WPA_FINISH_PROCESS,
WPA_FAIL
};
#endif /* ESP_SUPPLICANT */