From d870e4b95ce50b1635755025e2d8f50df093ab37 Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" Date: Fri, 29 Aug 2014 13:46:41 +0200 Subject: [PATCH] Windows does not support in_pktinfo.ipi_spec_dst --- configure.ac | 4 ++++ src/socket.c | 2 ++ 2 files changed, 6 insertions(+) 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) { -- 2.39.5