lwip-devel
[Top][All Lists]
Advanced

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

RE: [lwip-devel] Possibly falsely triggered LWIP_ASSERT?


From: Bill Auerbach
Subject: RE: [lwip-devel] Possibly falsely triggered LWIP_ASSERT?
Date: Tue, 29 Sep 2009 13:05:46 -0400

>OK, I've had a quick look at the code.  ip_input() calls pbuf_realloc()
>to shrink the pbuf down to the size of the IP data.  In your case it
>thinks it has been given 1064 bytes but the IP header says there is just
>1028 bytes.  I think this has been probably been passed up to the stack
>as two chained pbufs, most likely one full one of 1024 and the last 46
>bytes in the next pbuf.  Note that these numbers don't quite add up, but
>I'm not sure why: they mostly come from your first email.

Turns out I need:

#define PBUF_POOL_BUFSIZE
LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN+ETH_PAD_SIZE)

Note the addition of ETH_PAD_SIZE.  This is because this padding is
transferred from the MAC and I've been overrunning the payload area by 2
bytes.

I suggest this addition in case others use PBUF_POOL_BUFSIZE for Ethernet
packet allocation.

Bill





reply via email to

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