]> git.meshlink.io Git - catta/blobdiff - src/socket.c
Ensure make distcheck runs without errors.
[catta] / src / socket.c
index 7e893a0e041b03a557c05deae8316251f0be9729..31adcf81a99e5080ccd7ea7af3e80be8c0bee1f4 100644 (file)
@@ -21,6 +21,8 @@
 #include <config.h>
 #endif
 
+#define __APPLE_USE_RFC_2292
+
 #include <inttypes.h>
 #include <errno.h>
 #include <string.h>
@@ -105,7 +107,7 @@ static void ipv6_address_to_sockaddr(struct sockaddr_in6 *ret_sa, const CattaIPv
     memcpy(&ret_sa->sin6_addr, a, sizeof(CattaIPv6Address));
 }
 
-int catta_mdns_mcast_join_ipv4(int fd, const CattaIPv4Address *a, int idx, int join) {
+int catta_mdns_mcast_join_ipv4(int fd, const CattaIPv4Address *a, CattaIfIndex idx, int join) {
 #ifdef HAVE_STRUCT_IP_MREQN
     struct ip_mreqn mreq;
 #else
@@ -141,7 +143,7 @@ int catta_mdns_mcast_join_ipv4(int fd, const CattaIPv4Address *a, int idx, int j
     return 0;
 }
 
-int catta_mdns_mcast_join_ipv6(int fd, const CattaIPv6Address *a, int idx, int join) {
+int catta_mdns_mcast_join_ipv6(int fd, const CattaIPv6Address *a, CattaIfIndex idx, int join) {
     struct ipv6_mreq mreq6;
     struct sockaddr_in6 sa6;
 
@@ -615,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;
 
@@ -638,6 +645,7 @@ int catta_send_dns_packet_ipv6(
         msg.msg_control = NULL;
         msg.msg_controllen = 0;
     }
+#endif
 
     return sendmsg_loop(fd, &msg, 0);
 }