[haiku-development] Re: GSoC ICMP implementation

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 24 Mar 2008 16:49:13 +0100 CET

Hi Alan,

"Alvarez, Alan SPC MIL USA FORSCOM" <alan.alvarez@xxxxxxxxxxx> wrote:
> It seems that the ipv4 header is being removed from the packet before 
> the buffer is
> passed to the other layers. This is from ipv4_receive_data():
> 
>         gBufferModule->remove_header(buffer, headerLength);
>                 // the header is of variable size and may include IP 
> options
>                 // (that we ignore for now)
> 
> I'm not sure if this is the case because I don't really understand 
> how the BufferModule
> works internally. Although it has a pretty good interface and seems 
> easy to use, the inner
> workings of it seem a little complex. If the IP header is in fact 
> being removed from the
> buffer, this would have to be modified for error-handling purposes.

The header is in fact removed, however the bytes that contain the 
header remain unchanged in the buffer (until someone else claims them). 
However, if the header was in a buffer on its own, it will be recycled 
directly.

> In ICMP, when you send an error back to the source, for most messages 
> you have to send
> back the original IP header as part of the packet. It would then have 
> to be the next protocol's
> job to dispose of the IP header too.

I'm not sure if I like that a lot, since you'll then again carry IPv4 
depending information into the upper protocol layers (when only the 
error protocol needs to know about that).
If ICMP registers itself with IPv4 anyway, the error handler could be 
called separately and before the header is cut off. Maybe you'll find a 
better solution, though :-)

Bye,
   Axel.


Other related posts: