mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(esp_wifi): Mask some error conditions in WPS
Mask some error conditions in WPS to increase the probability of WPS success.
This commit is contained in:
parent
3a35b26de1
commit
3629909b11
@ -624,14 +624,14 @@ int wps_process_wps_mX_req(u8 *ubuf, int len, enum wps_process_res *res)
|
||||
if (expd->opcode != WSC_Start) {
|
||||
wpa_printf(MSG_DEBUG, "EAP-WSC: Unexpected Op-Code %d "
|
||||
"in WAIT_START state", expd->opcode);
|
||||
return ESP_FAIL;
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
wpa_printf(MSG_DEBUG, "EAP-WSC: Received start");
|
||||
sm->state = WPA_MESG;
|
||||
} else if (expd->opcode == WSC_Start) {
|
||||
wpa_printf(MSG_DEBUG, "EAP-WSC: Unexpected Op-Code %d",
|
||||
expd->opcode);
|
||||
return ESP_FAIL;
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
flag = *(u8 *)(ubuf + sizeof(struct eap_expand));
|
||||
@ -1096,6 +1096,8 @@ int wps_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len)
|
||||
wpa_printf(MSG_DEBUG, "sm->wps->state = %d", sm->wps->state);
|
||||
wps_start_msg_timer();
|
||||
}
|
||||
} else if (ret == ESP_ERR_INVALID_STATE) {
|
||||
ret = ESP_OK;
|
||||
} else {
|
||||
ret = ESP_FAIL;
|
||||
}
|
||||
@ -1658,6 +1660,7 @@ wifi_wps_scan_done(void *arg, ETS_STATUS status)
|
||||
esp_wifi_set_config(0, &wifi_config);
|
||||
|
||||
wpa_printf(MSG_DEBUG, "WPS: neg start");
|
||||
wifi_config.sta.failure_retry_cnt = 2;
|
||||
esp_wifi_connect();
|
||||
sm->state = WAIT_START;
|
||||
eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user