We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc6c39e commit a66d130Copy full SHA for a66d130
components/lwip/lwip/src/core/tcp.c
@@ -62,6 +62,10 @@
62
63
#include <string.h>
64
65
+#if ESP_LWIP
66
+#include "arch/sys_arch.h"
67
+#endif
68
+
69
#ifdef LWIP_HOOK_FILENAME
70
#include LWIP_HOOK_FILENAME
71
#endif
@@ -847,9 +851,13 @@ tcp_new_port(void)
847
851
struct tcp_pcb *pcb;
848
852
849
853
again:
854
855
+ tcp_port = (u16_t)(esp_random() % (TCP_LOCAL_PORT_RANGE_END - TCP_LOCAL_PORT_RANGE_START)) + TCP_LOCAL_PORT_RANGE_START;
856
+#else
850
857
if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) {
858
tcp_port = TCP_LOCAL_PORT_RANGE_START;
859
}
860
861
/* Check all PCB lists. */
862
for (i = 0; i < NUM_TCP_PCB_LISTS; i++) {
863
for (pcb = *tcp_pcb_lists[i]; pcb != NULL; pcb = pcb->next) {
0 commit comments