lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] pbuf_cat() does not update total_len


From: address@hidden
Subject: Re: [lwip-devel] pbuf_cat() does not update total_len
Date: Tue, 03 Feb 2015 20:28:57 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Laurenz Kamp wrote:
First pbuf:     a.len = 10;
                a.total_len = 25;
                a.next = b;
Second pbuf:    b.len = 15;
                b.total_len = 15;  <-- Should be 25.
                b.next = NULL;

Laurenz, your assumption is wrong. The above numbers are exactly right as they are.

As far as I understand, all pbufs in a chain have the same total_len value, but 
pbuf_cat doesn't
update b.total_len. Is this behavior intentioned or a bug?

As written above, it's expected behaviour. And the reason for this is that you can create or hide network headers in the pbuf (as it gets passed up or down the stack) and don't need to manipulate the whole chain but only the first pbuf in it.

Simon



reply via email to

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