diff --git a/0111-support-udp-pkglen-mtu-free-pbuf-chain-memory.patch b/0111-support-udp-pkglen-mtu-free-pbuf-chain-memory.patch new file mode 100644 index 0000000000000000000000000000000000000000..5d9e4b3c0688f1b6310104194b56393e2e616fa4 --- /dev/null +++ b/0111-support-udp-pkglen-mtu-free-pbuf-chain-memory.patch @@ -0,0 +1,36 @@ +From d46cc286ae617f6e12c4c8508dca3e672f1af670 Mon Sep 17 00:00:00 2001 +From: yangchen +Date: Sat, 2 Mar 2024 12:44:41 +0800 +Subject: [PATCH] support udp pkglen > mtu: free pbuf chain memory + +--- + src/core/udp.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/core/udp.c b/src/core/udp.c +index 440f909..de6204e 100644 +--- a/src/core/udp.c ++++ b/src/core/udp.c +@@ -1032,9 +1032,19 @@ udp_sendto_if_src_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *d + if (q != p) + #endif + { ++#if GAZELLE_UDP_ENABLE ++ /* if the udp packet len > mtu, the pbuf chain needs to be freed */ ++ struct pbuf *next; ++ while (q != NULL) { ++ next = q->next; ++ pbuf_free(q); ++ q = next; ++ } ++#else /* GAZELLE_UDP_ENABLE */ + /* free the header pbuf */ + pbuf_free(q); + q = NULL; ++#endif /* GAZELLE_UDP_ENABLE */ + /* p is still referenced by the caller, and will live on */ + } + +-- +2.33.0 + diff --git a/lwip.spec b/lwip.spec index f4d07f57250022774b68ae847e3e8e44dd1122c7..6792f3493f3d206be2e02c858b69e0cdf88fc117 100644 --- a/lwip.spec +++ b/lwip.spec @@ -4,7 +4,7 @@ Summary: lwip is a small independent implementation of the TCP/IP protocol suite Name: lwip Version: 2.2.0 -Release: 2 +Release: 3 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -122,6 +122,7 @@ Patch9106: 0107-fix-move-lpcb-to-the-front-of-list-error.patch Patch9107: 0108-fix-receive-fin-packet-process-error.patch Patch9108: 0109-support-udp-recv-zero-packets.patch Patch9109: 0110-adapt-lwip-2.2.0.patch +Patch9110: 0111-support-udp-pkglen-mtu-free-pbuf-chain-memory.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -151,6 +152,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Sat Mar 02 2024 yangchen - 2.2.0-3 +- support udp pkglen > mtu: free pbuf chain memory + * Sun Feb 18 2024 jiangheng - 2.2.0-2 - remove backport patches - sys_mbox_new return error when rte ring create failed