RE: IP options IP_RECVOPTS on Linux 2.6 - Kindly comment

From: Eric Dumazet
Date: Fri Apr 27 2012 - 01:31:42 EST


On Fri, 2012-04-27 at 05:25 +0000, S, Sreeram wrote:
> Thanks a lot Ravi for the response.
>
> But, the IP header is 40 bytes and so I think I should expect all
> those 40 bytes to be returned to my program when I enable this option.
> Isnt that correct ?
>
> Here, TTL and TOS are getting returned because I have explicitly
> enabled the returns of IP_RECVTTL and IP_RECVTOS to my program using
> setsockopt. Otherwise even they wouldnât have been returned.
>
> I still think that the kernel is not returning what it should return
> when I enable IP_RECVOPTS. Please correct me if you think I am wrong.
>
>
>
> Also, what are the other ways of getting the IP header other than RAW
> sockets, if the current approach does not work?
>
>

IP options are not IP header.

Try to send an IP packets with options, and your program will work.




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