From 91afefa61abc86154faef931fca5d7715f985f9d Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 7 Mar 2007 15:47:54 +0000 Subject: [PATCH] Reverted pbuf_alloc() to REV 1.82 --- src/core/pbuf.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index 51ae6f5a..ad9305a6 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -216,7 +216,7 @@ pbuf_alloc(pbuf_layer l, u16_t length, pbuf_flag flag) { struct pbuf *p, *q, *r; u16_t offset; - u16_t rem_len; /* remaining length */ + s32_t rem_len; /* remaining length */ LWIP_DEBUGF(PBUF_DEBUG | DBG_TRACE | 3, ("pbuf_alloc(length=%"U16_F")\n", length)); /* determine header offset */ @@ -270,7 +270,6 @@ pbuf_alloc(pbuf_layer l, u16_t length, pbuf_flag flag) /* remember first pbuf for linkage in next iteration */ r = p; /* remaining length to be allocated */ - LWIP_ASSERT("length >= p->len", length >= p->len); rem_len = length - p->len; /* any remaining pbufs to be allocated? */ while (rem_len > 0) { @@ -297,10 +296,7 @@ pbuf_alloc(pbuf_layer l, u16_t length, pbuf_flag flag) ((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0); q->ref = 1; /* calculate remaining length to be allocated */ - if(q->len < rem_len) - rem_len -= q->len; - else - rem_len = 0; + rem_len -= q->len; /* remember this pbuf for linkage in next iteration */ r = q; }