linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* IPV6_RECVPKTINFO fix
@ 2012-10-09 13:06 bert hubert
       [not found] ` <20121009130632.GA16787-UEKwcDob1UlZy7985ye5QA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: bert hubert @ 2012-10-09 13:06 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	linux-man-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 949 bytes --]

Hi everybody,

Recently PowerDNS needed to support the getting of the original destination
address of packets received on ::. Following the advice in ipv6(7) generated
an error on setsockopt(). 

Some googling confirmed that setsockopt() with IPV6_PKTINFO indeed does not
work, but we found that IPV6_RECVPKTINFO did. 

Our experiences are detailed in
http://bert-hubert.blogspot.nl/2012/10/on-binding-datagram-udp-sockets-to-any.html

Please find attached a quite naive patch to ipv6.7 that at least fixes 'my'
problem, but does not document if IPV6_PKTINFO ever worked as a flag. It
does document that IPV6_RECVPKTINFO is available since 2.6.13.

Please let me know if this patch is acceptable, or if you want me to dig
deeper into the IPV6_PKTINFO situation.

Thanks!

-- 
PowerDNS Website: http://www.powerdns.com/
PowerDNS Community Website: http://wiki.powerdns.com/
PowerDNS is supported and developed by Netherlabs: http://www.netherlabs.nl

[-- Attachment #2: ip_recvpktinfo.diff --]
[-- Type: text/x-diff, Size: 1025 bytes --]

diff --git a/man7/ipv6.7 b/man7/ipv6.7
index c539083..8c61905 100644
--- a/man7/ipv6.7
+++ b/man7/ipv6.7
@@ -141,7 +141,6 @@ 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_2292PKTINFO is not documented, and probably should be
 .\" FIXME there are probably many other IPV6_* socket options that
 .\" should be documented
@@ -183,10 +182,10 @@ in an integer.
 Control whether the socket sees multicast packets that it has send itself.
 Argument is a pointer to boolean.
 .TP
-.B IPV6_PKTINFO
+.B IPV6_RECVPKTINFO
 Set delivery of the
 .B IPV6_PKTINFO
-control message on incoming datagrams.
+control message on incoming datagrams. Such control messages contain a struct in6_pktinfo, as per RFC 3542. Available since Linux 2.6.13.
 Only allowed for
 .B SOCK_DGRAM
 or

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-21 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-09 13:06 IPV6_RECVPKTINFO fix bert hubert
     [not found] ` <20121009130632.GA16787-UEKwcDob1UlZy7985ye5QA@public.gmane.org>
2012-10-21 11:05   ` Michael Kerrisk (man-pages)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).