From 8ddc482f28472eb54ca643fe7a5944349d84993e Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Tue, 18 Oct 2022 16:40:32 +0800 Subject: [PATCH 1/3] lwip:bugfix for increase ping task stack size --- components/lwip/include/apps/ping/ping_sock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lwip/include/apps/ping/ping_sock.h b/components/lwip/include/apps/ping/ping_sock.h index fb946f7e16..6abe6f77bd 100644 --- a/components/lwip/include/apps/ping/ping_sock.h +++ b/components/lwip/include/apps/ping/ping_sock.h @@ -88,7 +88,7 @@ typedef struct { .tos = 0, \ .ttl = IP_DEFAULT_TTL, \ .target_addr = *(IP_ANY_TYPE), \ - .task_stack_size = 2048, \ + .task_stack_size = 2048 + TASK_EXTRA_STACK_SIZE, \ .task_prio = 2, \ .interface = 0,\ } From a1658663728447810dbdcd7a5b547ccd0dfd23f4 Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Wed, 31 Aug 2022 17:28:17 +0800 Subject: [PATCH 2/3] Lwip:add TCP Fin2 timeout configuration * Update submodule: git log --oneline 76303df2386902e0d7873be4217f1d9d1b50f982..6132c9755a43d4e04de4457f1558ced415756e4d Detailed description of the changes: - napt: Fix clean compilation (espressif/esp-lwip@6132c975) - Lwip:add TCP Fin2 timeout configuration (espressif/esp-lwip@15b4400e) - napt: Fix IP forwarding when forward netif enable NAPT (espressif/esp-lwip@c950063f) - napt/stats: Move some napt counters to stats module (espressif/esp-lwip@475d658a) - ip_napt_maint: Fix timestamp overflow handling (espressif/esp-lwip@2e904508) - napt: Fixes and improvements (espressif/esp-lwip@fb1f3552) --- components/lwip/Kconfig | 8 +++++++- components/lwip/lwip | 2 +- components/lwip/port/esp32/include/lwipopts.h | 5 +++++ docs/en/api-guides/lwip.rst | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index 57e8c2b045..7c15daa570 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -506,7 +506,13 @@ menu "LWIP" int "Maximum segment lifetime (MSL)" default 60000 help - Set maximum segment lifetime in in milliseconds. + Set maximum segment lifetime in milliseconds. + + config LWIP_TCP_FIN_WAIT_TIMEOUT + int "Maximum FIN segment lifetime" + default 20000 + help + Set maximum segment lifetime in milliseconds. config LWIP_TCP_SND_BUF_DEFAULT int "Default send buffer size" diff --git a/components/lwip/lwip b/components/lwip/lwip index 76303df238..6132c9755a 160000 --- a/components/lwip/lwip +++ b/components/lwip/lwip @@ -1 +1 @@ -Subproject commit 76303df2386902e0d7873be4217f1d9d1b50f982 +Subproject commit 6132c9755a43d4e04de4457f1558ced415756e4d diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index bb0d371c6e..511d4fc0dd 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -359,6 +359,11 @@ */ #define TCP_MSL CONFIG_LWIP_TCP_MSL +/** + * TCP_FIN_WAIT_TIMEOUT: The maximum FIN segment lifetime in milliseconds + */ +#define TCP_FIN_WAIT_TIMEOUT CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT + /** * TCP_MAXRTX: Maximum number of retransmissions of data segments. */ diff --git a/docs/en/api-guides/lwip.rst b/docs/en/api-guides/lwip.rst index ecae070395..ae517d0800 100644 --- a/docs/en/api-guides/lwip.rst +++ b/docs/en/api-guides/lwip.rst @@ -439,6 +439,7 @@ Most lwIP RAM usage is on-demand, as RAM is allocated from the heap as needed. T - Reducing :ref:`CONFIG_LWIP_MAX_SOCKETS` reduces the maximum number of sockets in the system. This will also cause TCP sockets in the ``WAIT_CLOSE`` state to be closed and recycled more rapidly (if needed to open a new socket), further reducing peak RAM usage. - Reducing :ref:`CONFIG_LWIP_TCPIP_RECVMBOX_SIZE`, :ref:`CONFIG_LWIP_TCP_RECVMBOX_SIZE` and :ref:`CONFIG_LWIP_UDP_RECVMBOX_SIZE` reduce memory usage at the expense of throughput, depending on usage. +- Reducing :ref:`CONFIG_LWIP_TCP_MSL`, :ref:`CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT` reduces the maximum segment lifetime in the system. This will also cause TCP sockets in the ``TIME_WAIT``, ``FIN_WAIT_2`` state to be closed and recycled more rapidly - Disable :ref:`CONFIG_LWIP_IPV6` can save about 39 KB for firmware size and 2KB RAM when system power up and 7KB RAM when TCPIP stack running. If there is no requirement for supporting IPV6 then it can be disabled to save flash and RAM footprint. If using Wi-Fi, please also refer to :ref:`wifi-buffer-usage`. From 78021c0937bd7b15a45936b68c83616265f9de0a Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Mon, 31 Oct 2022 10:35:08 +0800 Subject: [PATCH 3/3] esp_wifi:bugfix sniffer mode can not capture control packet --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 82d31a4ac2..8b09cb3349 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 82d31a4ac25c7ce46891e1b75ce553e9c39cc3d1 +Subproject commit 8b09cb3349cf06886d4cd2703f4ac11c303b1806