lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Problem with LWIP_ERROR in pbuf_header(..)


From: address@hidden
Subject: Re: [lwip-devel] Problem with LWIP_ERROR in pbuf_header(..)
Date: Mon, 27 Apr 2009 20:39:13 +0200
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)

Justs an additional explanation: the ASSERT can (or should) only fail due to wrong configuration options (i.e. PBUF_POOL data size is too small to hold all the headers). We could discuss whether this should assert or not, but if not these problems would be harder to detect (you would have to debug why packets that are correct are rejected).

Simon


address@hidden wrote:
Fredrik Hederstierna wrote:
In the case you mention, shouldn't the first clause in the if statement
"if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN)"  protect us from the
assertion?  I.e. if the packet is short it should do that clause, but
then not the pbuf_header() call.
But is it true that always  (p->tot_len == p->len)  here ?
Maybe due to almost full memory  p->tot_len  is  larger than  p->len ?
The ERROR is checking  p->len,  but if-statement checks  p->tot_len.

I think you are right: if the first pbuf is smaller than the headers, the assert may fail. We should check p->len: the lwIP code definively can't cope with headers spreaded over multiple pbufs.

Simon


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






reply via email to

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