1 Star 0 Fork 48

yinbin6/lwip

forked from src-openEuler/lwip 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0071-fix-pbuf-tot_len-incorrect-after-pbuf_split_64k-is-c.patch 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
From 339ad47548236f2b11ee6161a419db8aa664138c Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Fri, 15 Sep 2023 09:33:56 +0800
Subject: [PATCH] fix pbuf->tot_len incorrect after pbuf_split_64k is called
---
src/core/pbuf.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/core/pbuf.c b/src/core/pbuf.c
index 2385e57..8a55463 100644
--- a/src/core/pbuf.c
+++ b/src/core/pbuf.c
@@ -1194,7 +1194,7 @@ void pbuf_split_64k(struct pbuf *p, struct pbuf **rest)
if (r != NULL) {
/* Update the tot_len field in the first part */
for (i = p; i != NULL; i = i->next) {
- i->tot_len = tot_len_front;
+ i->tot_len = (u16_t)(i->tot_len - r->tot_len);
LWIP_ASSERT("tot_len/len mismatch in last pbuf",
(i->next != NULL) || (i->tot_len == i->len));
}
@@ -1205,9 +1205,6 @@ void pbuf_split_64k(struct pbuf *p, struct pbuf **rest)
/* tot_len field in rest does not need modifications */
/* reference counters do not need modifications */
*rest = r;
- r->tot_len = r->len;
- }else{
- p->tot_len = tot_len_front;
}
}
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yinbin6/lwip.git
git@gitee.com:yinbin6/lwip.git
yinbin6
lwip
lwip
master

搜索帮助