-#define IPV6_PKTINFO 2
-#define IPV6_HOPOPTS 3
-#define IPV6_DSTOPTS 4
-#define IPV6_RTHDR 5
-#define IPV6_PKTOPTIONS 6
+#define IPV6_2292PKTINFO 2
+#define IPV6_2292HOPOPTS 3
+#define IPV6_2292DSTOPTS 4
+#define IPV6_2292RTHDR 5
+#define IPV6_2292PKTOPTIONS 6
+/* RFC3542 advanced socket options (50-67) */
+#define IPV6_RECVPKTINFO 50
+#define IPV6_PKTINFO 51
+#define IPV6_RECVHOPOPTS 56
+#define IPV6_HOPOPTS 57
#define IPV6_CHECKSUM 7
-#define IPV6_HOPLIMIT 8
+#define IPV6_2292HOPLIMIT 8
+#define IPV6_RTHDRDSTOPTS 59
+#define IPV6_RECVRTHDR 60
+#define IPV6_RTHDR 61
+#define IPV6_RECVDSTOPTS 62
+#define IPV6_DSTOPTS 63
+#define IPV6_RECVHOPLIMIT 64
+#define IPV6_HOPLIMIT 65
Looking more closely (i.e., beyond just the above), the summary is
that IPV6_PKTINFO disappeared from the getsockopt/setsockopt API, and
IPV6_2292PKTINFO took its place. Meanwhile, IPV6_RECVPKTINFO was
Then kernel commit b24a2516d10751d7ed5afb58420df25370c9dffb (Dec 2008)
added IPV6_PKTINFO back to the getsockopt/getsockopt API, but with
what looks to be a rather different meaning (it takes a 'struct
in6_pktinfo' as the third arg).
This seems consistent (if confusing) with the RFCs:
http://www.ietf.org/rfc/rfc3542.txt (obsoletes 2292)
Both of those RFCs define an IPV6_PKTINO sockopt, but the former takes
an int arg, and the latter takes the 'struct in6_pktinfo'.
So, my summary of your patch is that it's correct. But I think that
IPV6_RECVPKTINFO is present since 2.6.14, not 2.6.13, and I tweaked
your patch (see below).
But it'd be great if the netdev folk in general could send in
documentation patches, or at least CC firstname.lastname@example.org, for
future API changes.
@@ -141,7 +141,7 @@ structure.
.\" FIXME IPV6_CHECKSUM is not documented, and probably should be
.\" FIXME IPV6_JOIN_ANYCAST is not documented, and probably should be
.\" FIXME IPV6_LEAVE_ANYCAST is not documented, and probably should be
-.\" FIXME IPV6_RECVPKTINFO is not documented, and probably should be
+.\" FIXME IPV6_PKTINFO is not documented, and probably should be
.\" FIXME IPV6_2292PKTINFO is not documented, and probably should be
.\" FIXME there are probably many other IPV6_* socket options that
.\" should be documented
@@ -183,10 +183,11 @@ in an integer.
Control whether the socket sees multicast packets that it has send itself.
Argument is a pointer to boolean.
+.BR IPV6_RECVPKTINFO " (since Linux 2.6.14)"
Set delivery of the
control message on incoming datagrams.
+Such control messages contain a struct in6_pktinfo, as per RFC 3542.
Only allowed for