Skip to content

Commit 3629909

Browse files
kapilkedawatespressif-bot
authored andcommitted
fix(esp_wifi): Mask some error conditions in WPS
Mask some error conditions in WPS to increase the probability of WPS success.
1 parent 3a35b26 commit 3629909

File tree

1 file changed

+5
-2
lines changed
  • components/wpa_supplicant/esp_supplicant/src

1 file changed

+5
-2
lines changed

components/wpa_supplicant/esp_supplicant/src/esp_wps.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,14 +624,14 @@ int wps_process_wps_mX_req(u8 *ubuf, int len, enum wps_process_res *res)
624624
if (expd->opcode != WSC_Start) {
625625
wpa_printf(MSG_DEBUG, "EAP-WSC: Unexpected Op-Code %d "
626626
"in WAIT_START state", expd->opcode);
627-
return ESP_FAIL;
627+
return ESP_ERR_INVALID_STATE;
628628
}
629629
wpa_printf(MSG_DEBUG, "EAP-WSC: Received start");
630630
sm->state = WPA_MESG;
631631
} else if (expd->opcode == WSC_Start) {
632632
wpa_printf(MSG_DEBUG, "EAP-WSC: Unexpected Op-Code %d",
633633
expd->opcode);
634-
return ESP_FAIL;
634+
return ESP_ERR_INVALID_STATE;
635635
}
636636

637637
flag = *(u8 *)(ubuf + sizeof(struct eap_expand));
@@ -1096,6 +1096,8 @@ int wps_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len)
10961096
wpa_printf(MSG_DEBUG, "sm->wps->state = %d", sm->wps->state);
10971097
wps_start_msg_timer();
10981098
}
1099+
} else if (ret == ESP_ERR_INVALID_STATE) {
1100+
ret = ESP_OK;
10991101
} else {
11001102
ret = ESP_FAIL;
11011103
}
@@ -1658,6 +1660,7 @@ wifi_wps_scan_done(void *arg, ETS_STATUS status)
16581660
esp_wifi_set_config(0, &wifi_config);
16591661

16601662
wpa_printf(MSG_DEBUG, "WPS: neg start");
1663+
wifi_config.sta.failure_retry_cnt = 2;
16611664
esp_wifi_connect();
16621665
sm->state = WAIT_START;
16631666
eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL);

0 commit comments

Comments
 (0)