From: Sven M. Hallberg Date: Fri, 29 Aug 2014 11:46:41 +0000 (+0200) Subject: Windows does not support in_pktinfo.ipi_spec_dst X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=d870e4b95ce50b1635755025e2d8f50df093ab37;p=catta Windows does not support in_pktinfo.ipi_spec_dst --- diff --git a/configure.ac b/configure.ac index 3c872a0..1be1466 100644 --- a/configure.ac +++ b/configure.ac @@ -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 ]]) # -fstack-protector AC_ARG_ENABLE([stack-protector], diff --git a/src/socket.c b/src/socket.c index 4c991e7..1914316 100644 --- a/src/socket.c +++ b/src/socket.c @@ -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) {