<div dir="ltr">Hi, maybe it's a naive question. But I am confused here.<div><br></div><div>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. </div>
<div><br></div><div>I checked some example of socket API "<span style="color:rgb(0,0,0)">setsockopt", it also just converts the target options data pointer into a char * pointer and passes down to "</span>ip_options_get_from_user<span style="color:rgb(0,0,0)">", still it doesn't set these two values.</span></div>
<div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">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.</span></div>
<div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><pre style="color:rgb(0,0,0)">struct linger linger = { 0 };
linger.l_onoff = 1;
linger.l_linger = 30;
status = setsockopt(serverSocket,
SOL_SOCKET, SO_LINGER,
(const char *) &linger,
sizeof(linger));</pre></div></div>