]> git.meshlink.io Git - catta/commitdiff
Windows does not support in_pktinfo.ipi_spec_dst
authorSven M. Hallberg <pesco@khjk.org>
Fri, 29 Aug 2014 11:46:41 +0000 (13:46 +0200)
committerSven M. Hallberg <pesco@khjk.org>
Fri, 29 Aug 2014 11:46:41 +0000 (13:46 +0200)
configure.ac
src/socket.c

index 3c872a06d1bf51a2e6bdc5b91b5a84eb93baa475..1be1466b2b0c896de79ee1a1f43ff4e17f57572d 100644 (file)
@@ -58,6 +58,10 @@ fi
 # Windows stuff
 AC_CHECK_DECL(_WIN32)
 AM_CONDITIONAL([WINDOWS], [ test "x$ac_cv_have_decl__WIN32" = "xyes" ])
+AC_CHECK_MEMBER([struct in_pktinfo.ipi_spec_dst],
+    AC_DEFINE([HAVE_IPI_SPEC_DST], [], [struct in_pktinfo has ipi_spec_dst member]),
+    [],
+    [[#include <ws2tcpip.h>]])
 
 # -fstack-protector
 AC_ARG_ENABLE([stack-protector],
index 4c991e7dd3ee899957ac7256828116efa5d94033..1914316716861442ae149dcac1e6a2866ced1632 100644 (file)
@@ -527,8 +527,10 @@ int catta_send_dns_packet_ipv4(
         if (iface > 0)
             pkti->ipi_ifindex = iface;
 
+#ifdef HAVE_IPI_SPEC_DST
         if (src_address)
             pkti->ipi_spec_dst.s_addr = src_address->address;
+#endif
     }
 #elif defined(IP_MULTICAST_IF)
     if (src_address) {