IPV6_RECVPKTINFO vs. IPV6_PKTINFO
Dear all,
Trying to compile latest master on snow leopard, I've noticed that IPV6_RECVPKTINFO is missing from Mac OS X. So here's a tiny little trivial patch that makes socket.c fallback to IPV6_PKTINFO accordingly.
If what is being done on
http://www.opensource.apple.com/source/network_cmds/network_cmds-307.0.1/rtsol.tproj/rtsol.cis
any indicator, using IPV6_PKTINFO instead of IPV6_RECVPKTINFO in snow should yield no differences.
Best Regards,
Athanasios
From 7ca12f531e94a577ada535d25f99865e35fdb256 Mon Sep 17 00:00:00 2001
From: aduitsis <[email protected]>
Date: Mon, 27 Jun 2011 23:22:43 +0300
Subject: [PATCH] minor change to handle absense of IPV6_RECVPKTINFO on Mac OS X
--- socket.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
socket.c +7 -0
@@ -890,10 +890,17 @@ create_socket_udp6 (const unsigned int flags) else if (flags & SF_USE_IP_PKTINFO) {int pad =1 ; +#ifdef IPV6_RECVPKTINFO if (setsockopt (sd,IPPROTO_IPV6 ,IPV6_RECVPKTINFO , (void *)&pad,sizeof (pad)) <0 )msg (M_SOCKERR ,"UDP: failed setsockopt for IPV6_RECVPKTINFO" ); } +#else +if (setsockopt (sd,IPPROTO_IPV6 ,IPV6_PKTINFO , + (void *)&pad,sizeof (pad)) <0 ) + msg(M_SOCKERR, "UDP: failed setsockopt for IPV6_RECVPKTINFO"); + } +#endif #endif return sd; }
Signature · 1 line
1.6.1.3