mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 04:04:31 +02:00
Merge branch 'bugfix/fix_some_wifi_bugs_1202_v3.3' into 'release/v3.3'
esp_wifi: fix some wifi bugs 1202 (backport v3.3) See merge request espressif/esp-idf!11437
This commit is contained in:
@@ -333,6 +333,13 @@ menu "LWIP"
|
|||||||
change the memory usage of LWIP, except for preventing
|
change the memory usage of LWIP, except for preventing
|
||||||
new listening TCP connections after the limit is reached.
|
new listening TCP connections after the limit is reached.
|
||||||
|
|
||||||
|
config LWIP_TCP_HIGH_SPEED_RETRANSMISSION
|
||||||
|
bool "TCP high speed retransmissions"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Speed up the TCP retransmission interval. If disabled,
|
||||||
|
it is recommended to change the number of SYN retransmissions to 6,
|
||||||
|
and TCP initial rto time to 3000.
|
||||||
|
|
||||||
config TCP_MAXRTX
|
config TCP_MAXRTX
|
||||||
int "Maximum number of retransmissions of data segments"
|
int "Maximum number of retransmissions of data segments"
|
||||||
@@ -343,7 +350,8 @@ menu "LWIP"
|
|||||||
|
|
||||||
config TCP_SYNMAXRTX
|
config TCP_SYNMAXRTX
|
||||||
int "Maximum number of retransmissions of SYN segments"
|
int "Maximum number of retransmissions of SYN segments"
|
||||||
default 6
|
default 6 if !LWIP_TCP_HIGH_SPEED_RETRANSMISSION
|
||||||
|
default 12 if LWIP_TCP_HIGH_SPEED_RETRANSMISSION
|
||||||
range 3 12
|
range 3 12
|
||||||
help
|
help
|
||||||
Set maximum number of retransmissions of SYN segments.
|
Set maximum number of retransmissions of SYN segments.
|
||||||
@@ -477,7 +485,8 @@ menu "LWIP"
|
|||||||
|
|
||||||
config LWIP_TCP_RTO_TIME
|
config LWIP_TCP_RTO_TIME
|
||||||
int "Default TCP rto time"
|
int "Default TCP rto time"
|
||||||
default 3000
|
default 3000 if !LWIP_TCP_HIGH_SPEED_RETRANSMISSION
|
||||||
|
default 1500 if LWIP_TCP_HIGH_SPEED_RETRANSMISSION
|
||||||
help
|
help
|
||||||
Set default TCP rto time for a reasonable initial rto.
|
Set default TCP rto time for a reasonable initial rto.
|
||||||
In bad network environment, recommend set value of rto time to 1500.
|
In bad network environment, recommend set value of rto time to 1500.
|
||||||
|
@@ -18,4 +18,15 @@ menu "Supplicant"
|
|||||||
which will cause M2 validation fail, bypassing WPS-Config method
|
which will cause M2 validation fail, bypassing WPS-Config method
|
||||||
validation.
|
validation.
|
||||||
|
|
||||||
|
config WPA_DEBUG_PRINT
|
||||||
|
bool "Print debug messages from WPA Supplicant"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Select this option to print logging information from WPA supplicant,
|
||||||
|
this includes handshake information and key hex dumps depending
|
||||||
|
on the project logging level.
|
||||||
|
|
||||||
|
Enabling this could increase the build size ~60kb
|
||||||
|
depending on the project logging level.
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
@@ -47,6 +47,11 @@ void wpa_debug_close_file(void);
|
|||||||
*/
|
*/
|
||||||
void wpa_debug_print_timestamp(void);
|
void wpa_debug_print_timestamp(void);
|
||||||
|
|
||||||
|
#if CONFIG_WPA_DEBUG_PRINT
|
||||||
|
#define DEBUG_PRINT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_PRINT
|
||||||
/**
|
/**
|
||||||
* wpa_printf - conditional printf
|
* wpa_printf - conditional printf
|
||||||
* @level: priority level (MSG_*) of the message
|
* @level: priority level (MSG_*) of the message
|
||||||
@@ -58,8 +63,17 @@ void wpa_debug_print_timestamp(void);
|
|||||||
*
|
*
|
||||||
* Note: New line '\n' is added to the end of the text when printing to stdout.
|
* Note: New line '\n' is added to the end of the text when printing to stdout.
|
||||||
*/
|
*/
|
||||||
#define DEBUG_PRINT
|
|
||||||
#define MSG_PRINT
|
#define wpa_printf(level,fmt, args...) ESP_LOG_LEVEL_LOCAL(level, TAG, fmt, ##args)
|
||||||
|
|
||||||
|
static inline void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf, size_t len)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wpa_hexdump - conditional hex dump
|
* wpa_hexdump - conditional hex dump
|
||||||
@@ -72,19 +86,6 @@ void wpa_debug_print_timestamp(void);
|
|||||||
* output may be directed to stdout, stderr, and/or syslog based on
|
* output may be directed to stdout, stderr, and/or syslog based on
|
||||||
* configuration. The contents of buf is printed out has hex dump.
|
* configuration. The contents of buf is printed out has hex dump.
|
||||||
*/
|
*/
|
||||||
#ifdef DEBUG_PRINT
|
|
||||||
#define wpa_printf(level,fmt, args...) ESP_LOG_LEVEL_LOCAL(level, TAG, fmt, ##args)
|
|
||||||
|
|
||||||
static inline void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf, size_t len)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len);
|
void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len);
|
||||||
|
|
||||||
static inline void wpa_hexdump_buf(int level, const char *title,
|
static inline void wpa_hexdump_buf(int level, const char *title,
|
||||||
@@ -148,13 +149,14 @@ void wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
|
|||||||
void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
|
void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
|
||||||
size_t len);
|
size_t len);
|
||||||
#else
|
#else
|
||||||
#define wpa_printf(level,fmt, args...)
|
#define wpa_printf(level,fmt, args...) do {} while(0)
|
||||||
#define wpa_hexdump(...)
|
#define wpa_hexdump(...) do {} while(0)
|
||||||
#define wpa_hexdump_buf(...)
|
#define wpa_dump_mem(...) do {} while(0)
|
||||||
#define wpa_hexdump_key(...)
|
#define wpa_hexdump_buf(...) do {} while(0)
|
||||||
#define wpa_hexdump_buf_key(...)
|
#define wpa_hexdump_key(...) do {} while(0)
|
||||||
#define wpa_hexdump_ascii(...)
|
#define wpa_hexdump_buf_key(...) do {} while(0)
|
||||||
#define wpa_hexdump_ascii_key(...)
|
#define wpa_hexdump_ascii(...) do {} while(0)
|
||||||
|
#define wpa_hexdump_ascii_key(...) do {} while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define wpa_auth_logger
|
#define wpa_auth_logger
|
||||||
|
@@ -1038,7 +1038,9 @@ get_defaults:
|
|||||||
int eap_peer_tls_phase2_nak(struct eap_method_type *types, size_t num_types,
|
int eap_peer_tls_phase2_nak(struct eap_method_type *types, size_t num_types,
|
||||||
struct eap_hdr *hdr, struct wpabuf **resp)
|
struct eap_hdr *hdr, struct wpabuf **resp)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_PRINT
|
||||||
u8 *pos = (u8 *) (hdr + 1);
|
u8 *pos = (u8 *) (hdr + 1);
|
||||||
|
#endif
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
/* TODO: add support for expanded Nak */
|
/* TODO: add support for expanded Nak */
|
||||||
|
@@ -2486,14 +2486,18 @@ static int wps_process_wps_state(struct wps_data *wps, const u8 *state)
|
|||||||
|
|
||||||
static int wps_process_assoc_state(struct wps_data *wps, const u8 *assoc)
|
static int wps_process_assoc_state(struct wps_data *wps, const u8 *assoc)
|
||||||
{
|
{
|
||||||
u16 a;
|
#ifdef DEBUG_PRINT
|
||||||
|
u16 a;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (assoc == NULL) {
|
if (assoc == NULL) {
|
||||||
wpa_printf(MSG_DEBUG, "WPS: No Association State received");
|
wpa_printf(MSG_DEBUG, "WPS: No Association State received");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_PRINT
|
||||||
a = WPA_GET_BE16(assoc);
|
a = WPA_GET_BE16(assoc);
|
||||||
|
#endif
|
||||||
wpa_printf(MSG_DEBUG, "WPS: Enrollee Association State %d", a);
|
wpa_printf(MSG_DEBUG, "WPS: Enrollee Association State %d", a);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -2502,14 +2506,18 @@ static int wps_process_assoc_state(struct wps_data *wps, const u8 *assoc)
|
|||||||
|
|
||||||
static int wps_process_config_error(struct wps_data *wps, const u8 *err)
|
static int wps_process_config_error(struct wps_data *wps, const u8 *err)
|
||||||
{
|
{
|
||||||
u16 e;
|
#ifdef DEBUG_PRINT
|
||||||
|
u16 e;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (err == NULL) {
|
if (err == NULL) {
|
||||||
wpa_printf(MSG_DEBUG, "WPS: No Configuration Error received");
|
wpa_printf(MSG_DEBUG, "WPS: No Configuration Error received");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_PRINT
|
||||||
e = WPA_GET_BE16(err);
|
e = WPA_GET_BE16(err);
|
||||||
|
#endif
|
||||||
wpa_printf(MSG_DEBUG, "WPS: Enrollee Configuration Error %d", e);
|
wpa_printf(MSG_DEBUG, "WPS: Enrollee Configuration Error %d", e);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -30,13 +30,13 @@ See the [README.md](./espnow/README.md) file in the project [espnow](./espnow/).
|
|||||||
|
|
||||||
Show how to use fast scan while connecting to an AP.
|
Show how to use fast scan while connecting to an AP.
|
||||||
|
|
||||||
See the [README.md](./fast_scan/README.md) file in the project [espnow](./espnow/).
|
See the [README.md](./fast_scan/README.md) file in the project [fast_scan](./fast_scan/).
|
||||||
|
|
||||||
## scan
|
## scan
|
||||||
|
|
||||||
Show how to scan for all the available APs.
|
Show how to scan for all the available APs.
|
||||||
|
|
||||||
See the [README.md](./scan/README.md) file in the project [espnow](./espnow/).
|
See the [README.md](./scan/README.md) file in the project [scan](./scan/).
|
||||||
|
|
||||||
# More
|
# More
|
||||||
|
|
||||||
|
@@ -135,7 +135,7 @@ static esp_err_t IRAM_ATTR iperf_run_tcp_server(void)
|
|||||||
int listen_socket;
|
int listen_socket;
|
||||||
struct timeval t;
|
struct timeval t;
|
||||||
int sockfd;
|
int sockfd;
|
||||||
int opt;
|
int opt = 1;
|
||||||
|
|
||||||
listen_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
listen_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
if (listen_socket < 0) {
|
if (listen_socket < 0) {
|
||||||
@@ -206,7 +206,7 @@ static esp_err_t IRAM_ATTR iperf_run_udp_server(void)
|
|||||||
int want_recv = 0;
|
int want_recv = 0;
|
||||||
uint8_t *buffer;
|
uint8_t *buffer;
|
||||||
int sockfd;
|
int sockfd;
|
||||||
int opt;
|
int opt = 1;
|
||||||
bool udp_recv_start = true ;
|
bool udp_recv_start = true ;
|
||||||
|
|
||||||
sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||||
@@ -264,7 +264,7 @@ static esp_err_t iperf_run_udp_client(void)
|
|||||||
int want_send = 0;
|
int want_send = 0;
|
||||||
uint8_t *buffer;
|
uint8_t *buffer;
|
||||||
int sockfd;
|
int sockfd;
|
||||||
int opt;
|
int opt = 1;
|
||||||
int err;
|
int err;
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user