11 Star 76 Fork 103

OpenHarmony/third_party_lwip

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
0071-fix-pbuf-tot_len-incorrect-after-pbuf_split_64k-is-c.patch 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
Aurora 提交于 2023-12-07 03:26 . update lwip to 2.1.3-39.oe2203sp1
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/openharmony/third_party_lwip.git
git@gitee.com:openharmony/third_party_lwip.git
openharmony
third_party_lwip
third_party_lwip
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385