From: everHannes Date: Mon, 31 Aug 2015 15:33:56 +0000 (+0200) Subject: disable to send src_address with windows ipv6 as it somehow causes WSASendMsg to... X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=c2402d570bf271cc589df511b01e2d570b43c35f;p=catta disable to send src_address with windows ipv6 as it somehow causes WSASendMsg to fail with an Invalid Argument error 10022 #3 --- 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); }