From dcc6049444f5e12e0d0fcc4cfbb244c08b4c20b0 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 14 Apr 2010 14:46:21 +0200 Subject: Fixes IPv6 build on older systems. --- sysdep/unix/io.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sysdep') diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index d1fad1f..c9e6fe1 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) { -- cgit v1.2.3 From 607d991424006c083be63878b6a606e76679e1ce Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 14 Apr 2010 15:35:08 +0200 Subject: Fixes build on newer Linux systems. --- sysdep/unix/io.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysdep') diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index c9e6fe1..dc7146f 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -7,6 +7,10 @@ * Can be freely distributed and used under the terms of the GNU GPL. */ +/* Unfortunately, some glibc versions hide parts of RFC 3542 API + if _GNU_SOURCE is not defined. */ +#define _GNU_SOURCE 1 + #include #include #include -- cgit v1.2.3