lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] pbuf_header fails in etharp_output


From: Kieran Mansley
Subject: Re: [lwip-users] pbuf_header fails in etharp_output
Date: Tue, 22 May 2007 11:06:11 +0100

On Tue, 2007-05-22 at 11:50 +0200, Matthias Weisser wrote:
> Hi
> 
> The ping problem I had yesterday disappears when I use a Linux system
> to ping my target. Now the ICMP packet from Linux arrives inside the
> lwIP stack and a valid reply message is created. This message is then
> passed to etharp_output which tries to make room for the ethernet
> header with the pbuf_header function. But this wont work. This
> 
> if ((u8_t *)p->payload < (u8_t *)p + sizeof(struct pbuf))
> 
> is true and therefor the function fails. I don't have any idea how to
> fix this. Maybe its quite a simple problem (missing define?). 

lwIP is a little bit cheeky and reuses the pbuf with the ICMP request to
form the ICMP reply.  It is therefore assuming that there is room at the
front for the necessary headers.  I suppose if your ethernet driver was
being very efficient and had stripped off the ethernet header before
creating the pbuf, this might not be the case.  Can you show how you're
creating the pbuf for the received ICMP packet?

The other thing to check is what the value is for the PBUF_LINK_HLEN,
and what the values in that "if" statement above are.

Kieran





reply via email to

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