Re: How does raw socket implementation handle ICMP (or any other non-kernel related protocols)

Andi Kleen (ak-uu@muc.de)
29 Sep 1999 13:11:12 +0200


shankarv@future.futsoft.com (Shankar Vasudevan) writes:

> hi gurus,
>
> I make the following assumption (text in bold), if its wrong tell me the actual story.
>
> "In ip.c ip gives the whole ip packet (with header) to the raw socket implementation. (RSI)

Correct.

But please don't invent new acronyms like that.

>
>
> RSI strips the ip header off and gives the "raw ICMP" packet to the application which uses the socket.

Raw sockets always deliver with the IP header.

>
>
> Also the application when it wants to send a "raw ICMP" packet, it gives it to the RSI, which in turn
> gives it to ip.c which wraps it with IP header and sends it out."

Unless you set IP_HDRINCL yes.

>
> is the story same for any other non-kernel related protocols.
>

Yes. And even for kernel related protocols.

This all and more is documented in raw(7), part of manpages 1.25+

-Andi

-- 
This is like TV. I don't like TV.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/