Re: working of setsockopt() and getsockopt()

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

 




Amit Kucheria wrote:

> I have set some IP options for my sockets (IP_HDRINCL & IP_ROUTER_ALERT)  
> using setsockopt(), but when I do a getsockopt(), nothing is reflected.
> I know I am forgetting something very elementary here, but cant put my 
> finger on it. Any pointers are welcome.

IP_HDRINCL and IP_ROUTER_ALERT aren't "options", in the sense of
IP_OPTIONS.

Calling getsockopt() on any of the above options should return
whatever value was set by a preceding setsockopt() call. However, each
of these options is independent; setting one of them won't change any
of the others.

Also, if you set both IP_HDRINCL and IP_OPTIONS, IP_OPTIONS is
ignored.

-- 
Glynn Clements <glynn.clements@virgin.net>
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux