diff --git a/0102-dfx-add-tcp_in-empty-ack-cnt-and-del-rst-invalid-log.patch b/0102-dfx-add-tcp_in-empty-ack-cnt-and-del-rst-invalid-log.patch new file mode 100644 index 0000000..7b56836 --- /dev/null +++ b/0102-dfx-add-tcp_in-empty-ack-cnt-and-del-rst-invalid-log.patch @@ -0,0 +1,76 @@ +From 105f7e2a5828d1999bdbf0bb64d336f22dc67859 Mon Sep 17 00:00:00 2001 +From: yangchen +Date: Mon, 8 Jan 2024 15:22:09 +0800 +Subject: [PATCH] dfx: add tcp_in empty ack cnt and del rst invalid log + +--- + src/core/tcp_in.c | 8 ++++++-- + src/include/lwip/stats.h | 1 + + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c +index 69dcd26..40b87fc 100644 +--- a/src/core/tcp_in.c ++++ b/src/core/tcp_in.c +@@ -523,6 +523,7 @@ tcp_input(struct pbuf *p, struct netif *inp) + if (pcb->rcv_ann_wnd == 0) { + /* this is a zero-window probe, we respond to it with current RCV.NXT + and drop the data segment */ ++ MIB2_STATS_INC(mib2.tcpinemptyacks); + tcp_send_empty_ack(pcb); + } + TCP_STATS_INC(tcp.drop); +@@ -687,8 +688,7 @@ aborted: + if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) { + TCP_STATS_INC(tcp.proterr); + 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", ++ LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, send RST, local_port=%d, remote_port=%d\n", + tcphdr->dest, tcphdr->src)); + tcp_rst(NULL, ackno, seqno + tcplen, ip_current_dest_addr(), + ip_current_src_addr(), tcphdr->dest, tcphdr->src); +@@ -1547,6 +1547,7 @@ tcp_receive(struct tcp_pcb *pcb) + /* End of ACK for new data processing. */ + } else { + /* Out of sequence ACK, didn't really ack anything */ ++ MIB2_STATS_INC(mib2.tcpinemptyacks); + tcp_send_empty_ack(pcb); + } + +@@ -1848,6 +1849,7 @@ tcp_receive(struct tcp_pcb *pcb) + but lwIP currently does not support including SACKs in data packets. So we force + it to respond with an empty ACK packet (only if there is at least one SACK to be sent). + NOTE: tcp_send_empty_ack() on success clears the ACK flags (set by tcp_ack()) */ ++ MIB2_STATS_INC(mib2.tcpinemptyacks); + tcp_send_empty_ack(pcb); + } + #endif /* LWIP_TCP_SACK_OUT */ +@@ -2088,10 +2090,12 @@ tcp_receive(struct tcp_pcb *pcb) + + /* We send the ACK packet after we've (potentially) dealt with SACKs, + so they can be included in the acknowledgment. */ ++ MIB2_STATS_INC(mib2.tcpinemptyacks); + tcp_send_empty_ack(pcb); + } + } else { + /* The incoming segment is not within the window. */ ++ MIB2_STATS_INC(mib2.tcpinemptyacks); + tcp_send_empty_ack(pcb); + } + } else { +diff --git a/src/include/lwip/stats.h b/src/include/lwip/stats.h +index 805836c..08c34e9 100644 +--- a/src/include/lwip/stats.h ++++ b/src/include/lwip/stats.h +@@ -156,6 +156,7 @@ struct stats_mib2 { + u32_t tcpoutofseq; + u32_t tcpacceptmboxfull; + u32_t tcplistendrops; ++ u32_t tcpinemptyacks; + + /* UDP */ + u32_t udpindatagrams; +-- +2.33.0 + diff --git a/lwip.spec b/lwip.spec index e6d3f33..7ffa6da 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: 106 +Release: 107 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -115,6 +115,7 @@ Patch9097: 0098-remove-duplicate-lwip-log.patch Patch9098: 0099-fix-rte_ring_create-time-consuming.patch Patch9099: 0100-replace-qtuple-addr-with-gz_addr_t.patch Patch9100: 0101-fix-wrong-namelen-in-getaddrname.patch +Patch9101: 0102-dfx-add-tcp_in-empty-ack-cnt-and-del-rst-invalid-log.patch Patch6005: backport-tcp_in-fix-ooseq-update-error.patch @@ -147,6 +148,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Wed Jan 10 2024 yangchen - 2.1.3-107 +- dfx: add tcp_in empty ack cnt and del rst invalid log + * Mon Jan 08 2024 zhengjiebing - 2.1.3-106 - fix wrong namelen in lwip_getaddrname