summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-04-14 14:46:21 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-04-14 14:46:21 +0200
commitdcc6049444f5e12e0d0fcc4cfbb244c08b4c20b0 (patch)
tree6f4ed3ca220e5c11693b9bb7b031b5fdfaa823de
parent6e8067609673afef9eb9e786f4e43a73a3b544f0 (diff)
Fixes IPv6 build on older systems.
-rw-r--r--sysdep/unix/io.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index d1fad1ff..c9e6fe13 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -668,6 +668,16 @@ get_sockaddr(struct sockaddr_in *sa, ip_addr *a, unsigned *port, int check)
#define CMSG_RX_SPACE CMSG_SPACE(sizeof(struct in6_pktinfo))
#define CMSG_TX_SPACE CMSG_SPACE(sizeof(struct in6_pktinfo))
+/*
+ * RFC 2292 uses IPV6_PKTINFO for both the socket option and the cmsg
+ * type, RFC 3542 changed the socket option to IPV6_RECVPKTINFO. If we
+ * don't have IPV6_RECVPKTINFO we suppose the OS implements the older
+ * RFC and we use IPV6_PKTINFO.
+ */
+#ifndef IPV6_RECVPKTINFO
+#define IPV6_RECVPKTINFO IPV6_PKTINFO
+#endif
+
static char *
sysio_register_cmsgs(sock *s)
{