A question about ip_options's option type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, maybe it's a naive question. But I am confused here.

For the options field of an IP header, as for the data in this field, according to document and the code in the method of "ip_options_compile", the first byte is  the options type data and the second byte is the length of the option. But I traced back the method of "ip_options_get_from_user", there is no place that assign these two values to the __data field. 

I checked some example of socket API "setsockopt", it also just converts the target options data pointer into a char * pointer and passes down to "ip_options_get_from_user", still it doesn't set these two values.

Can anyone help me on this? Because I am trying to add my own options to IP header at the IP layer for some experiment purposes.


struct linger linger = { 0 };
linger.l_onoff = 1;
linger.l_linger = 30;
status = setsockopt(serverSocket,
SOL_SOCKET, SO_LINGER,
(const char *) &linger,
sizeof(linger));
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux