Remember head of queue in pbuf_queue() iff PBUF_DEBUG to generate senseful debug report.

This commit is contained in:
likewise 2004-05-05 14:28:41 +00:00
parent c69b93b246
commit e84cc8c0ad

View File

@ -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 */