From e84cc8c0adecd868edf0818816a2288892e42944 Mon Sep 17 00:00:00 2001 From: likewise Date: Wed, 5 May 2004 14:28:41 +0000 Subject: [PATCH] Remember head of queue in pbuf_queue() iff PBUF_DEBUG to generate senseful debug report. --- src/core/pbuf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index ce12680a..47608f74 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -715,15 +715,16 @@ pbuf_chain(struct pbuf *h, struct pbuf *t) * */ void -pbuf_queue(struct pbuf *q, struct pbuf *n) +pbuf_queue(struct pbuf *p, struct pbuf *n) { - struct pbuf *p; +#if PBUF_DEBUG /* remember head of queue */ + struct pbuf *q = p; +#endif /* programmer stupidity checks */ LWIP_ASSERT("p != NULL", p != NULL); LWIP_ASSERT("n != NULL", n != NULL); if ((p == NULL) || (n == NULL)) return; - p = q; /* iterate through all packets on queue */ while (p->next != NULL) { /* be very picky about pbuf chain correctness */