lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] pbuf len field equal zero


From: EVS Hardware Dpt
Subject: Re: [lwip-users] pbuf len field equal zero
Date: Tue, 13 Dec 2005 14:36:22 +0100

Christiaan,

I you look in my code you'll see that I loop until the sum of all individual len fields equals the tot_len field of the first pbuf in the chain. After your answer, I've changed it to your proposal (nicer than the one I use), but the problem is still there. In the middle of a pbuf chain I get a pbuf with a len field being 0. If I skip it, then I broke the chain and I my ISR when calling pbuf_free, I suspect that the whole chain is not freed correctly.

I have some difficulties to understand the signification of a pbuf wich len field is 0. Is it normal ? Can I simply remove this entry and rebuild the chain without it ? For example :

q = p;
while(1)
{
   if(q->next->len == 0)
   {
      q->next = q->next->next;
   }
   q = q->next
}

This code is just for illustration, if it appears that I must rebuild the chain, then there are a lot of things to double check.

Thanks,
Frederic.


2005/12/13, Christiaan Simons <address@hidden>:
lwip-users-bounces+christiaan.simons=address@hidden wrote on 12-12-2005
18:02:27:

> My question is : why do I have some pbuf with len field being 0 ? Is
> it normal, what should I do with them ?

Taken from the comment in lwip/src/core/pbuf.c

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

Maybe this helps?

Bye,

Christiaan Simons

Hardware / Software Engineer
Axon Digital Design

+31 (0)13 511 66 66
+31 (0)13 511 41 51

http://www.axon.tv


This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
This message contains confidential information and is intended only for the
individual named.  If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

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