1From ce3debdf4c4cd6701cdb323377477539a5fd13fa Mon Sep 17 00:00:00 2001 2From: yangchen <yangchen145@huawei.com> 3Date: Fri, 15 Dec 2023 17:21:54 +0800 4Subject: [PATCH] lwip log: fix reversed port in tcp_input 5 6--- 7 src/core/tcp_in.c | 10 +++++----- 8 1 file changed, 5 insertions(+), 5 deletions(-) 9 10diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c 11index 24706c1..c76c114 100644 12--- a/src/core/tcp_in.c 13+++ b/src/core/tcp_in.c 14@@ -689,7 +689,7 @@ aborted: 15 TCP_STATS_INC(tcp.drop); 16 LWIP_DEBUGF(TCP_RST_DEBUG | GAZELLE_DEBUG_SERIOUS, 17 ("tcp_input: no PCB match found, send RST, local_port=%d, remote_port=%d\n", 18- tcphdr->src, tcphdr->dest)); 19+ tcphdr->dest, tcphdr->src)); 20 tcp_rst(NULL, ackno, seqno + tcplen, ip_current_dest_addr(), 21 ip_current_src_addr(), tcphdr->dest, tcphdr->src); 22 } 23@@ -766,7 +766,7 @@ tcp_listen_input(struct tcp_pcb_listen *pcb) 24 RST. */ 25 LWIP_DEBUGF(TCP_RST_DEBUG | GAZELLE_DEBUG_SERIOUS, 26 ("tcp_listen_input: ACK in LISTEN, send reset, local_port=%d, remote_port=%d\n", 27- tcphdr->src, tcphdr->dest)); 28+ tcphdr->dest, tcphdr->src)); 29 tcp_rst((const struct tcp_pcb *)pcb, ackno, seqno + tcplen, ip_current_dest_addr(), 30 ip_current_src_addr(), tcphdr->dest, tcphdr->src); 31 } else if (flags & TCP_SYN) { 32@@ -903,7 +903,7 @@ tcp_timewait_input(struct tcp_pcb *pcb) 33 /* If the SYN is in the window it is an error, send a reset */ 34 LWIP_DEBUGF(GAZELLE_DEBUG_SERIOUS, 35 ("tcp_timewait_input: SYN in TIME_WAIT, send RST, local_port=%d, remote_port=%d\n", 36- tcphdr->src, tcphdr->dest)); 37+ tcphdr->dest, tcphdr->src)); 38 tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), 39 ip_current_src_addr(), tcphdr->dest, tcphdr->src); 40 return; 41@@ -1073,7 +1073,7 @@ tcp_process(struct tcp_pcb *pcb) 42 else if (flags & TCP_ACK) { 43 /* send a RST to bring the other side in a non-synchronized state. */ 44 LWIP_DEBUGF(GAZELLE_DEBUG_SERIOUS, ("tcp_process: ACK in SYN_SENT, send RST, local_port=%d, remote_port=%d\n", 45- tcphdr->src, tcphdr->dest)); 46+ tcphdr->dest, tcphdr->src)); 47 tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), 48 ip_current_src_addr(), tcphdr->dest, tcphdr->src); 49 /* Resend SYN immediately (don't wait for rto timeout) to establish 50@@ -1146,7 +1146,7 @@ tcp_process(struct tcp_pcb *pcb) 51 /* incorrect ACK number, send RST */ 52 LWIP_DEBUGF(GAZELLE_DEBUG_SERIOUS, 53 ("tcp_process: incorrect ACK number in SYN_RCVD, send RST, ackno=%d, lastack=%d, snd_nxt=%d, local_port=%d, remote_port=%d\n", 54- ackno, pcb->lastack, pcb->snd_nxt, tcphdr->src, tcphdr->dest)); 55+ ackno, pcb->lastack, pcb->snd_nxt, tcphdr->dest, tcphdr->src)); 56 tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), 57 ip_current_src_addr(), tcphdr->dest, tcphdr->src); 58 } 59-- 602.33.0 61 62