From c2402d570bf271cc589df511b01e2d570b43c35f Mon Sep 17 00:00:00 2001 From: everHannes Date: Mon, 31 Aug 2015 17:33:56 +0200 Subject: [PATCH] disable to send src_address with windows ipv6 as it somehow causes WSASendMsg to fail with an Invalid Argument error 10022 #3 --- src/socket.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/socket.c b/src/socket.c index 4f60139..31adcf8 100644 --- a/src/socket.c +++ b/src/socket.c @@ -617,6 +617,11 @@ int catta_send_dns_packet_ipv6( msg.msg_iovlen = 1; msg.msg_flags = 0; +// TODO: don't ask me why, but Win8.1 64bit WSASendMsg() fails with an InvalidArgument error 10022 when IPv6 source address is specified ( everHannes / hannes.ahrens@everbase.net ) +#ifdef _WIN32 + msg.msg_control = NULL; + msg.msg_controllen = 0; +#else if (iface > 0 || src_address) { struct in6_pktinfo *pkti; @@ -640,6 +645,7 @@ int catta_send_dns_packet_ipv6( msg.msg_control = NULL; msg.msg_controllen = 0; } +#endif return sendmsg_loop(fd, &msg, 0); } -- 2.39.5