Michael Kerrisk wrote: > > -.I IP_RECVTTL > > +.I IP_TTL > > So is it the case that this option was just wrongly named in the > original page, or is the change here reflective of something that > has changed in the kernel? (It doesn't look like the latter is > true, but I thought it better to check.)
AFAIK it isn't changed, I just discovered it while trying to use it that although socket option is IP_RECVTTL, I didn't receive ancillary data with this type as expected. Instead of this there was data with type IP_TTL. > > control message with the time to live > > field of the received packet as a byte. Not supported for > > .B SOCK_STREAM > > @@ -789,6 +789,20 @@ received datagrams. Linux has the more g > > .I IP_PKTINFO > > for the same task. > > .PP > > +Some BSD sockets implementations also provide > > +.I IP_RECVTTL > > +option, but ancillary message with type > > +.I IP_RECVTTL > > +is passed with incoming packet. It's different from > > +.I IP_TTL > > +used in Linux. > > From reading the sources, Linux appears to have both > IP_RECVTTL and IP_TTL. So, does there not also need > to be some documentation of the "real" IP_RECVTTL? You seems to be confused ;). In short: 1) IP_TTL socket option is to _set_ TTL for outgoing packets. 2) IP_RECVTTL socket option is to _get_ TTL with incoming packets as ancillary data. But this ancillary data structure doesn't have type IP_RECVTTL (as many would expect, imho), but IP_TTL. > > +.PP > > +Using > > +.I SOL_IP > > +socket options level isn't portable, BSD-based stacks use > > +.I IPPROTO_IP > > +level. > > Recently (not yet published), I went though ip(7), tcp(7), udp(7) > etc, and changed SOL_IP to IPPROTO_IP, SOL_TCP to IPPROTO_TCP, > etc, on the basis that > > -- the IPPROTO_* constants are what appear in POSIX, and That's good enough reason, IMHO. -- Hasso Tepper Elion Enterprises Ltd. WAN administrator - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html