diff options
author | Gert Doering | 2016-09-16 21:02:42 +0200 |
---|---|---|
committer | Gert Doering | 2016-09-17 12:24:02 +0200 |
commit | 7efa60d9790e029b8f9efd6a0ca06312d31d3420 (patch) | |
tree | 99033989b5d2cd98ed3e24218688986bbb2f073a /src/openvpn/socket.h | |
parent | a85ba0e06badf9932e80deb53b68f50611943c6e (diff) | |
download | openvpn-7efa60d9790e029b8f9efd6a0ca06312d31d3420.zip openvpn-7efa60d9790e029b8f9efd6a0ca06312d31d3420.tar.gz |
Fix IP_PKTINFO related compilation failure on NetBSD 7.0
NetBSD has introduced IP_PKTINFO and struct in_pktinfo, but does not
have the "ipi_spec_dst" structure element, causing compilation errors.
Introduce a check for that (AC_CHECK_MEMBER) in configure.ac, and
change all "#ifdef HAVE_IN_PKTINFO" to also check "HAVE_IPI_SPEC_DST".
Patch inspired by NetBSD pkgsrc patch set.
(Note: with that patch, OpenVPN --multihome is still broken for IPv4
on NetBSD 7.0.1 / amd64, but that's a different issue)
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20160916190242.44897-1-gert@greenie.muc.de>
URL: http://www.mail-archive.com/search?l=mid&q=20160916190242.44897-1-gert@greenie.muc.de
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/socket.h')
-rw-r--r-- | src/openvpn/socket.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openvpn/socket.h b/src/openvpn/socket.h index 66824c7..e1607f4 100644 --- a/src/openvpn/socket.h +++ b/src/openvpn/socket.h @@ -90,7 +90,7 @@ struct link_socket_actual struct openvpn_sockaddr dest; #if ENABLE_IP_PKTINFO union { -#ifdef HAVE_IN_PKTINFO +#if defined(HAVE_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST) struct in_pktinfo in4; #elif defined(IP_RECVDSTADDR) struct in_addr in4; @@ -626,7 +626,7 @@ addr_defined_ipi (const struct link_socket_actual *lsa) #if ENABLE_IP_PKTINFO if (!lsa) return 0; switch (lsa->dest.addr.sa.sa_family) { -#ifdef HAVE_IN_PKTINFO +#if defined(HAVE_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST) case AF_INET: return lsa->pi.in4.ipi_spec_dst.s_addr != 0; #elif defined(IP_RECVDSTADDR) case AF_INET: return lsa->pi.in4.s_addr != 0; |