mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02: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:
@@ -605,14 +605,14 @@ int wps_process_wps_mX_req(u8 *ubuf, int len, enum wps_process_res *res)
|
|||||||
if (expd->opcode != WSC_Start) {
|
if (expd->opcode != WSC_Start) {
|
||||||
wpa_printf(MSG_DEBUG, "EAP-WSC: Unexpected Op-Code %d "
|
wpa_printf(MSG_DEBUG, "EAP-WSC: Unexpected Op-Code %d "
|
||||||
"in WAIT_START state", expd->opcode);
|
"in WAIT_START state", expd->opcode);
|
||||||
return ESP_FAIL;
|
return ESP_ERR_INVALID_STATE;
|
||||||
}
|
}
|
||||||
wpa_printf(MSG_DEBUG, "EAP-WSC: Received start");
|
wpa_printf(MSG_DEBUG, "EAP-WSC: Received start");
|
||||||
sm->state = WPA_MESG;
|
sm->state = WPA_MESG;
|
||||||
} else if (expd->opcode == WSC_Start) {
|
} else if (expd->opcode == WSC_Start) {
|
||||||
wpa_printf(MSG_DEBUG, "EAP-WSC: Unexpected Op-Code %d",
|
wpa_printf(MSG_DEBUG, "EAP-WSC: Unexpected Op-Code %d",
|
||||||
expd->opcode);
|
expd->opcode);
|
||||||
return ESP_FAIL;
|
return ESP_ERR_INVALID_STATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
flag = *(u8 *)(ubuf + sizeof(struct eap_expand));
|
flag = *(u8 *)(ubuf + sizeof(struct eap_expand));
|
||||||
@@ -1091,6 +1091,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);
|
wpa_printf(MSG_DEBUG, "sm->wps->state = %d", sm->wps->state);
|
||||||
wps_start_msg_timer();
|
wps_start_msg_timer();
|
||||||
}
|
}
|
||||||
|
} else if (ret == ESP_ERR_INVALID_STATE) {
|
||||||
|
ret = ESP_OK;
|
||||||
} else {
|
} else {
|
||||||
ret = ESP_FAIL;
|
ret = ESP_FAIL;
|
||||||
}
|
}
|
||||||
@@ -1653,6 +1655,7 @@ wifi_wps_scan_done(void *arg, STATUS status)
|
|||||||
esp_wifi_set_config(0, &wifi_config);
|
esp_wifi_set_config(0, &wifi_config);
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "WPS: neg start");
|
wpa_printf(MSG_DEBUG, "WPS: neg start");
|
||||||
|
wifi_config.sta.failure_retry_cnt = 2;
|
||||||
esp_wifi_connect();
|
esp_wifi_connect();
|
||||||
sm->state = WAIT_START;
|
sm->state = WAIT_START;
|
||||||
eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL);
|
eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL);
|
||||||
|
Reference in New Issue
Block a user