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



_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to