!669 tcp_send_fin: add the fin to the last unsent segment

From: @yangchen555 
Reviewed-by: @nlgwcy, @LemmyHuang 
Signed-off-by: @LemmyHuang
This commit is contained in:
openeuler-ci-bot 2023-12-25 07:14:14 +00:00 committed by Gitee
commit 0b57669e80
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From c91f1d05c65526fe250cf5e5c32f9038721bc1d5 Mon Sep 17 00:00:00 2001
From: yangchen <yangchen145@huawei.com>
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

View File

@ -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 <yangchen145@huawei.com> - 2.1.3-99
- tcp_send_fin: add the fin to the last unsent segment
* Wed Dec 20 2023 yangchen <yangchen145@huawei.com> - 2.1.3-98
- event_callback: del errevent log if err is ERR_OK