From 5f35f4bb3ba6da189e0e7f03812dc697d568011c Mon Sep 17 00:00:00 2001 From: likewise Date: Tue, 1 Apr 2003 09:35:20 +0000 Subject: [PATCH] Reverted back to David Haas' patch of pbuf_chain() from 1.34. --- src/core/pbuf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index dbc34bbf..7b1cb0aa 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -710,11 +710,12 @@ pbuf_chain(struct pbuf *h, struct pbuf *t) LWIP_ASSERT("t != NULL", t != NULL); /* proceed to last pbuf of chain */ - for (p = h; p != NULL; p = p->next) { + for (p = h; p->next != NULL; p = p->next) { /* add total length of second chain to all totals of first chain */ p->tot_len += t->tot_len; } - + /* add total length of second chain to last pbuf total of first chain */ + p->tot_len += t->tot_len; /* chain last pbuf of h chain (p) with first of tail (t) */ p->next = t; /* t is now referenced to one more time */