add check for struct in_pktinfo.ipi_spec_dst
PATCH 1/1 add check for struct in_pktinfo.ipi_spec_dst
While Windows has struct in_pktinfo it's missing the ipi_spec_dst member. The current autoconf check needs to be extended to also check for availablity of ipi_spec_dst for openvpn to compile cleanly.
Signed-off-by Heiko Hund <[email protected]...>
--- configure.ac | 6 ++++++ socket.h | 2 +- syshead.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-)
configure.ac +6 -0
@@ -503,6 +503,12 @@ AC_CHECK_TYPE( [AC_DEFINE(HAVE_IN_PKTINFO, 1, [struct in_pktinfo needed for IP_PKTINFO support])], [], [#include "syshead.h"]) +AC_CHECK_MEMBER( + [struct in_pktinfo.ipi_spec_dst], + [AC_DEFINE(HAVE_IPI_SPEC_DST, 1, [struct in_pktinfo.ipi_spec_dst needed for IP_PKTINFO support])], + [], + [#include "syshead.h"]) + AC_CHECK_SIZEOF(unsigned int) AC_CHECK_SIZEOF(unsigned long)
socket.h +1 -1
@@ -586,7 +586,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 ;
syshead.h +1 -1
@@ -404,7 +404,7 @@* Does this platform support linux-style IP_PKTINFO * or bsd-style IP_RECVDSTADDR ? */ -#if defined(ENABLE_MULTIHOME ) && ((defined(HAVE_IN_PKTINFO )&&defined(IP_PKTINFO )) || defined(IP_RECVDSTADDR )) && defined(HAVE_MSGHDR ) && defined(HAVE_CMSGHDR ) && defined(HAVE_IOVEC ) && defined(CMSG_FIRSTHDR ) && defined(CMSG_NXTHDR ) && defined(HAVE_RECVMSG ) && defined(HAVE_SENDMSG ) +#if defined(ENABLE_MULTIHOME ) && ((defined(HAVE_IN_PKTINFO )&&defined(HAVE_IPI_SPEC_DST )&&defined(IP_PKTINFO )) || defined(IP_RECVDSTADDR )) && defined(HAVE_MSGHDR ) && defined(HAVE_CMSGHDR ) && defined(HAVE_IOVEC ) && defined(CMSG_FIRSTHDR ) && defined(CMSG_NXTHDR ) && defined(HAVE_RECVMSG ) && defined(HAVE_SENDMSG )#define ENABLE_IP_PKTINFO 1#else #define ENABLE_IP_PKTINFO 0
Signature · 1 line
1.7.4.1