1195972f6Sopenharmony_ciFrom ce3debdf4c4cd6701cdb323377477539a5fd13fa Mon Sep 17 00:00:00 2001 2195972f6Sopenharmony_ciFrom: yangchen <yangchen145@huawei.com> 3195972f6Sopenharmony_ciDate: Fri, 15 Dec 2023 17:21:54 +0800 4195972f6Sopenharmony_ciSubject: [PATCH] lwip log: fix reversed port in tcp_input 5195972f6Sopenharmony_ci 6195972f6Sopenharmony_ci--- 7195972f6Sopenharmony_ci src/core/tcp_in.c | 10 +++++----- 8195972f6Sopenharmony_ci 1 file changed, 5 insertions(+), 5 deletions(-) 9195972f6Sopenharmony_ci 10195972f6Sopenharmony_cidiff --git a/src/core/tcp_in.c b/src/core/tcp_in.c 11195972f6Sopenharmony_ciindex 24706c1..c76c114 100644 12195972f6Sopenharmony_ci--- a/src/core/tcp_in.c 13195972f6Sopenharmony_ci+++ b/src/core/tcp_in.c 14195972f6Sopenharmony_ci@@ -689,7 +689,7 @@ aborted: 15195972f6Sopenharmony_ci TCP_STATS_INC(tcp.drop); 16195972f6Sopenharmony_ci LWIP_DEBUGF(TCP_RST_DEBUG | GAZELLE_DEBUG_SERIOUS, 17195972f6Sopenharmony_ci ("tcp_input: no PCB match found, send RST, local_port=%d, remote_port=%d\n", 18195972f6Sopenharmony_ci- tcphdr->src, tcphdr->dest)); 19195972f6Sopenharmony_ci+ tcphdr->dest, tcphdr->src)); 20195972f6Sopenharmony_ci tcp_rst(NULL, ackno, seqno + tcplen, ip_current_dest_addr(), 21195972f6Sopenharmony_ci ip_current_src_addr(), tcphdr->dest, tcphdr->src); 22195972f6Sopenharmony_ci } 23195972f6Sopenharmony_ci@@ -766,7 +766,7 @@ tcp_listen_input(struct tcp_pcb_listen *pcb) 24195972f6Sopenharmony_ci RST. */ 25195972f6Sopenharmony_ci LWIP_DEBUGF(TCP_RST_DEBUG | GAZELLE_DEBUG_SERIOUS, 26195972f6Sopenharmony_ci ("tcp_listen_input: ACK in LISTEN, send reset, local_port=%d, remote_port=%d\n", 27195972f6Sopenharmony_ci- tcphdr->src, tcphdr->dest)); 28195972f6Sopenharmony_ci+ tcphdr->dest, tcphdr->src)); 29195972f6Sopenharmony_ci tcp_rst((const struct tcp_pcb *)pcb, ackno, seqno + tcplen, ip_current_dest_addr(), 30195972f6Sopenharmony_ci ip_current_src_addr(), tcphdr->dest, tcphdr->src); 31195972f6Sopenharmony_ci } else if (flags & TCP_SYN) { 32195972f6Sopenharmony_ci@@ -903,7 +903,7 @@ tcp_timewait_input(struct tcp_pcb *pcb) 33195972f6Sopenharmony_ci /* If the SYN is in the window it is an error, send a reset */ 34195972f6Sopenharmony_ci LWIP_DEBUGF(GAZELLE_DEBUG_SERIOUS, 35195972f6Sopenharmony_ci ("tcp_timewait_input: SYN in TIME_WAIT, send RST, local_port=%d, remote_port=%d\n", 36195972f6Sopenharmony_ci- tcphdr->src, tcphdr->dest)); 37195972f6Sopenharmony_ci+ tcphdr->dest, tcphdr->src)); 38195972f6Sopenharmony_ci tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), 39195972f6Sopenharmony_ci ip_current_src_addr(), tcphdr->dest, tcphdr->src); 40195972f6Sopenharmony_ci return; 41195972f6Sopenharmony_ci@@ -1073,7 +1073,7 @@ tcp_process(struct tcp_pcb *pcb) 42195972f6Sopenharmony_ci else if (flags & TCP_ACK) { 43195972f6Sopenharmony_ci /* send a RST to bring the other side in a non-synchronized state. */ 44195972f6Sopenharmony_ci LWIP_DEBUGF(GAZELLE_DEBUG_SERIOUS, ("tcp_process: ACK in SYN_SENT, send RST, local_port=%d, remote_port=%d\n", 45195972f6Sopenharmony_ci- tcphdr->src, tcphdr->dest)); 46195972f6Sopenharmony_ci+ tcphdr->dest, tcphdr->src)); 47195972f6Sopenharmony_ci tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), 48195972f6Sopenharmony_ci ip_current_src_addr(), tcphdr->dest, tcphdr->src); 49195972f6Sopenharmony_ci /* Resend SYN immediately (don't wait for rto timeout) to establish 50195972f6Sopenharmony_ci@@ -1146,7 +1146,7 @@ tcp_process(struct tcp_pcb *pcb) 51195972f6Sopenharmony_ci /* incorrect ACK number, send RST */ 52195972f6Sopenharmony_ci LWIP_DEBUGF(GAZELLE_DEBUG_SERIOUS, 53195972f6Sopenharmony_ci ("tcp_process: incorrect ACK number in SYN_RCVD, send RST, ackno=%d, lastack=%d, snd_nxt=%d, local_port=%d, remote_port=%d\n", 54195972f6Sopenharmony_ci- ackno, pcb->lastack, pcb->snd_nxt, tcphdr->src, tcphdr->dest)); 55195972f6Sopenharmony_ci+ ackno, pcb->lastack, pcb->snd_nxt, tcphdr->dest, tcphdr->src)); 56195972f6Sopenharmony_ci tcp_rst(pcb, ackno, seqno + tcplen, ip_current_dest_addr(), 57195972f6Sopenharmony_ci ip_current_src_addr(), tcphdr->dest, tcphdr->src); 58195972f6Sopenharmony_ci } 59195972f6Sopenharmony_ci-- 60195972f6Sopenharmony_ci2.33.0 61195972f6Sopenharmony_ci 62