mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
WIFI: Iperf example's parameter opt was uninitialized, may leads setsockoption invalide if it equal to 0
This commit is contained in:
parent
c33fc7821a
commit
f70a819761
@ -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;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user