!653 lwip log: fix reversed port in tcp_input

From: @yangchen555 
Reviewed-by: @LemmyHuang 
Signed-off-by: @LemmyHuang
This commit is contained in:
openeuler-ci-bot 2023-12-15 09:54:02 +00:00 committed by Gitee
commit 47191c8ffd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,61 @@
From ce3debdf4c4cd6701cdb323377477539a5fd13fa Mon Sep 17 00:00:00 2001
From: yangchen <yangchen145@huawei.com>
Date: Fri, 15 Dec 2023 17:21:54 +0800
Subject: [PATCH] lwip log: fix reversed port in tcp_input
---
src/core/tcp_in.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c
index 24706c1..c76c114 100644
--- a/src/core/tcp_in.c
+++ b/src/core/tcp_in.c
@@ -689,7 +689,7 @@ aborted:
TCP_STATS_INC(tcp.drop);
LWIP_DEBUGF(TCP_RST_DEBUG | GAZELLE_DEBUG_SERIOUS,
("tcp_input: no PCB match found, send RST, local_port=%d, remote_port=%d\n",
- tcphdr->src, tcphdr->dest));
+ tcphdr->dest, tcphdr->src));
tcp_rst(NULL, ackno, seqno + tcplen, ip_current_dest_addr(),
ip_current_src_addr(), tcphdr->dest, tcphdr->src);
}
@@ -766,7 +766,7 @@ tcp_listen_input(struct tcp_pcb_listen *pcb)
RST. */
LWIP_DEBUGF(TCP_RST_DEBUG | GAZELLE_DEBUG_SERIOUS,
("tcp_listen_input: ACK in LISTEN, send reset, local_port=%d, remote_port=%d\n",
- tcphdr->src, tcphdr->dest));
+ tcphdr->dest, tcphdr->src));
tcp_rst((const struct tcp_pcb *)pcb, ackno, seqno + tcplen, ip_current_dest_addr(),
ip_current_src_addr(), tcphdr->dest, tcphdr->src);
} else if (flags & TCP_SYN) {
@@ -903,7 +903,7 @@ tcp_timewait_input(struct tcp_pcb *pcb)
/* If the SYN is in the window it is an error, send a reset */
LWIP_DEBUGF(GAZELLE_DEBUG_SERIOUS,
("tcp_timewait_input: SYN in TIME_WAIT, send RST, local_port=%d, remote_port=%d\n",
- tcphdr->src, tcphdr->dest));
+ tcphdr->dest, tcphdr->src));
tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(),
ip_current_src_addr(), tcphdr->dest, tcphdr->src);
return;
@@ -1073,7 +1073,7 @@ tcp_process(struct tcp_pcb *pcb)
else if (flags & TCP_ACK) {
/* send a RST to bring the other side in a non-synchronized state. */
LWIP_DEBUGF(GAZELLE_DEBUG_SERIOUS, ("tcp_process: ACK in SYN_SENT, send RST, local_port=%d, remote_port=%d\n",
- tcphdr->src, tcphdr->dest));
+ tcphdr->dest, tcphdr->src));
tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(),
ip_current_src_addr(), tcphdr->dest, tcphdr->src);
/* Resend SYN immediately (don't wait for rto timeout) to establish
@@ -1146,7 +1146,7 @@ tcp_process(struct tcp_pcb *pcb)
/* incorrect ACK number, send RST */
LWIP_DEBUGF(GAZELLE_DEBUG_SERIOUS,
("tcp_process: incorrect ACK number in SYN_RCVD, send RST, ackno=%d, lastack=%d, snd_nxt=%d, local_port=%d, remote_port=%d\n",
- ackno, pcb->lastack, pcb->snd_nxt, tcphdr->src, tcphdr->dest));
+ ackno, pcb->lastack, pcb->snd_nxt, tcphdr->dest, tcphdr->src));
tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(),
ip_current_src_addr(), tcphdr->dest, tcphdr->src);
}
--
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: 96
Release: 97
License: BSD
URL: http://savannah.nongnu.org/projects/lwip/
Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip
@ -107,6 +107,7 @@ Patch9089: 0090-frag-fix-coredump-when-get-netif.patch
Patch9090: 0091-add-fd-log-info-and-fix-wrong-port-log-info.patch
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
BuildRequires: gcc-c++ dos2unix dpdk-devel
@ -137,6 +138,9 @@ cd %{_builddir}/%{name}-%{version}/src
%{_libdir}/liblwip.a
%changelog
* Fri Dec 15 2023 yangchen <yangchen145@huawei.com> - 2.1.3-97
- lwip log: fix reversed port in tcp_input
* Thu Dec 14 2023 hankangkang <hankangkang5@huawei.com> - 2.1.3-96
- modfiy-accept-null-pointer-when-new-conn-receive-RST-packet-in-listening