• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 339ad47548236f2b11ee6161a419db8aa664138c Mon Sep 17 00:00:00 2001
2From: jiangheng <jiangheng14@huawei.com>
3Date: Fri, 15 Sep 2023 09:33:56 +0800
4Subject: [PATCH] fix pbuf->tot_len incorrect after pbuf_split_64k is called
5
6---
7 src/core/pbuf.c | 5 +----
8 1 file changed, 1 insertion(+), 4 deletions(-)
9
10diff --git a/src/core/pbuf.c b/src/core/pbuf.c
11index 2385e57..8a55463 100644
12--- a/src/core/pbuf.c
13+++ b/src/core/pbuf.c
14@@ -1194,7 +1194,7 @@ void pbuf_split_64k(struct pbuf *p, struct pbuf **rest)
15     if (r != NULL) {
16       /* Update the tot_len field in the first part */
17       for (i = p; i != NULL; i = i->next) {
18-        i->tot_len = tot_len_front;
19+        i->tot_len = (u16_t)(i->tot_len - r->tot_len);
20         LWIP_ASSERT("tot_len/len mismatch in last pbuf",
21                     (i->next != NULL) || (i->tot_len == i->len));
22       }
23@@ -1205,9 +1205,6 @@ void pbuf_split_64k(struct pbuf *p, struct pbuf **rest)
24       /* tot_len field in rest does not need modifications */
25       /* reference counters do not need modifications */
26       *rest = r;
27-      r->tot_len = r->len;
28-    }else{
29-      p->tot_len = tot_len_front;
30     }
31   }
32 }
33--
342.27.0
35
36