diff --git a/0096-tcp_send_fin-add-the-fin-to-the-last-unsent-segment.patch b/0096-tcp_send_fin-add-the-fin-to-the-last-unsent-segment.patch new file mode 100644 index 0000000..2e77f0e --- /dev/null +++ b/0096-tcp_send_fin-add-the-fin-to-the-last-unsent-segment.patch @@ -0,0 +1,27 @@ +From c91f1d05c65526fe250cf5e5c32f9038721bc1d5 Mon Sep 17 00:00:00 2001 +From: yangchen +Date: Mon, 25 Dec 2023 12:39:56 +0800 +Subject: [PATCH] tcp_send_fin: add the fin to the last unsent segment + +--- + src/core/tcp_out.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c +index 137e3cf..e5c407e 100644 +--- a/src/core/tcp_out.c ++++ b/src/core/tcp_out.c +@@ -1195,8 +1195,8 @@ tcp_send_fin(struct tcp_pcb *pcb) + LWIP_ASSERT("tcp_send_fin: invalid pcb", pcb != NULL); + + /* first, try to add the fin to the last unsent segment */ +- if (pcb->unsent != NULL) { +- struct tcp_seg *last_unsent = pcb->unsent; ++ if (pcb->last_unsent != NULL) { ++ struct tcp_seg *last_unsent = pcb->last_unsent; + + if ((TCPH_FLAGS(last_unsent->tcphdr) & (TCP_SYN | TCP_FIN | TCP_RST)) == 0) { + /* no SYN/FIN/RST flag in the header, we can add the FIN flag */ +-- +2.33.0 + diff --git a/lwip.spec b/lwip.spec index ae56f29..6bc6e06 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.1.3 -Release: 98 +Release: 99 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -109,6 +109,7 @@ Patch9091: 0092-fix-the-coredump-issue-when-UDP-traffic-is-sent.patch Patch9092: 0093-modfiy-accept-null-pointer-when-new-conn-receive-RST-packet-in-listening.patch Patch9093: 0094-lwip-log-fix-reversed-port-in-tcp_input.patch Patch9094: 0095-event_callback-del-errevent-log-if-err-is-ERR_OK.patch +Patch9095: 0096-tcp_send_fin-add-the-fin-to-the-last-unsent-segment.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -139,6 +140,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Sat Dec 23 2023 yangchen - 2.1.3-99 +- tcp_send_fin: add the fin to the last unsent segment + * Wed Dec 20 2023 yangchen - 2.1.3-98 - event_callback: del errevent log if err is ERR_OK