lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] question about pbuf_chain


From: Mike Tesch
Subject: [lwip-users] question about pbuf_chain
Date: Mon, 31 Mar 2003 14:02:05 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021202

Hello,

I'm having a problem sending udp data through the sockets interface ;-)

I think part of it is because pbuf_chain() is updating tot_len incorrectly.
Just to clarify, tot_len is "the sum of 'len' of all pbufs following this one?"

Is the following correct?
(changed line marked by <<<<<<<)

void
pbuf_chain(struct pbuf *h, struct pbuf *t)
{
 struct pbuf *p;

 LWIP_ASSERT("h != NULL", h != NULL);
 LWIP_ASSERT("t != NULL", t != NULL);

 /* proceed to last pbuf of chain */
 for (p = h; p != NULL; p = p->next) { <<<<<<<<
   /* add total length of second chain to all totals 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 */
 pbuf_ref(t);
DEBUGF(PBUF_DEBUG | DBG_FRESH | 2, ("pbuf_chain: referencing tail %p\n", (void *) t));
}






reply via email to

[Prev in Thread] Current Thread [Next in Thread]