RE: IP options IP_RECVOPTS on Linux 2.6 - Kindly comment

From: S, Sreeram
Date: Fri Apr 27 2012 - 01:34:32 EST


Thanks Eric.
I shall try that and I will reply. Thanks for the hint.

Regards,
Sreeram

-----Original Message-----
From: Eric Dumazet [mailto:eric.dumazet@xxxxxxxxx]
Sent: Friday, April 27, 2012 11:02 AM
To: S, Sreeram
Cc: Ravishankar; linux-kernel@xxxxxxxxxxxxxxx; Andy Lutomirski
Subject: RE: IP options IP_RECVOPTS on Linux 2.6 - Kindly comment

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.




N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i