If my understanding is correct, the pbuf that is passed to our recv callback is only the first in a chain, where we must traverse the chain to obtain the full packet?

I am confused by this line in the documentation:
"The last pbuf of a packet has a ->tot_len field that equals the ->len field. It can be found by traversing the list. If the last pbuf of a packet has a ->next field other than NULL, more packets are on the queue.

Therefore, looping through a pbuf of a single packet, has an loop end condition (tot_len == p->len), NOT (next == NULL)."

Why would there be two conditions? Is ever one true when the other isn't? How do the lengths add up if the first condition is true but the second isn't?

Does anyone have example code for how to obtain the full packet?


Thanks,
Mike

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to