1 Star 0 Fork 48

zhangyulongkylinos/lwip

forked from src-openEuler/lwip 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0102-dfx-add-tcp_in-empty-ack-cnt-and-del-rst-invalid-log.patch 2.92 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2024-02-06 10:45 . adapt lwip-2.2.0
From 105f7e2a5828d1999bdbf0bb64d336f22dc67859 Mon Sep 17 00:00:00 2001
From: yangchen <yangchen145@huawei.com>
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 118210a..d6f54b6 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_netif(ip_data.current_input_netif, ackno, seqno + tcplen, ip_current_dest_addr(),
ip_current_src_addr(), tcphdr->dest, tcphdr->src);
@@ -1517,6 +1517,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);
}
@@ -1818,6 +1819,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 */
@@ -2058,10 +2060,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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangyulongkylinos/lwip.git
git@gitee.com:zhangyulongkylinos/lwip.git
zhangyulongkylinos
lwip
lwip
master

搜索帮助