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 14:51:14 +0100

On Tue, 2007-05-22 at 15:47 +0200, Goldschmidt Simon wrote:
> > > That would make ICMP dependent of the link layer!
> > 
> > No more so than TCP, UDP, etc.  It would (if there wasn't 
> > enough space in the pbuf it already had) simply allocate a 
> > pbuf using the PBUF_IP pbuf_layer flag, and so it would have 
> > enough space reserved for the IP and link headers.
> 
> But how does the ICMP code know how much space to reserve fo the
> link layer?

Look at the start of pbuf_alloc().  It increases the required length
depending on what pbuf_layer is.  It uses the port-defined constants
PBUF_TRANSPORT_HLEN, PBUF_IP_HLEN and PBUF_LINK_HLEN to know how much it
needs to reserve for the headers of each layer.

Kieran





reply via email to

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