From 9ed2b7e03ca755aecc1fbbae4385707617d8b0a2 Mon Sep 17 00:00:00 2001 From: likewise Date: Wed, 4 Jun 2003 09:06:22 +0000 Subject: [PATCH] pbuf_alloc() forgot to set tot_len field for PBUF_POOL pbufs. --- src/core/pbuf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index b42d2c9b..cf00cbde 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -273,7 +273,9 @@ pbuf_alloc(pbuf_layer l, u16_t length, pbuf_flag flag) /*q->next = NULL;*/ /* make previous pbuf point to this pbuf */ r->next = q; - /* set length of this pbuf */ + /* set total length of this pbuf and next in chain */ + q->tot_len = rem_len; + /* this pbuf length is pool size, unless smaller sized tail */ q->len = rem_len > PBUF_POOL_BUFSIZE? PBUF_POOL_BUFSIZE: rem_len; q->flags = PBUF_FLAG_POOL; q->payload = (void *)((u8_t *)q + sizeof(struct pbuf));