lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #27576] pbuf_realloc will assert or crash on a non-cha


From: Kieran Mansley
Subject: [lwip-devel] [bug #27576] pbuf_realloc will assert or crash on a non-chained pbuf list
Date: Fri, 02 Oct 2009 13:45:49 +0000
User-agent: Opera/9.64 (X11; Linux i686; U; en) Presto/2.1.1

Follow-up Comment #4, bug #27576 (project lwip):

I've had a look at the code and we do have a check for ip length:

    if (iphdr_len > p->tot_len)

Clearly it relies on the p->tot_len being accurate, and this is down to the
driver.  

It sounds like in your case that it's passing the test above, but then
finding that the chain of pbufs is not as long as it should be when it comes
to the pbuf_realloc()

I'm guessing that the driver is allocating a pbuf (or a chain) for a received
packet, the packet is truncated for some reason, and the driver doesn't make
sure that p->tot_len is the sum of all the p->len in the chain. 

i.e. looks like it's a driver bug.

We could add a debug assertion to the code to enforce this, but I don't
really want to put in a non-debug check for something that the driver should
be getting right.

Could you check in your driver that p->tot_len is the sum of p->len at the
point at which it passes the pbuf to lwIP?

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27576>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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