]> git.meshlink.io Git - meshlink/commitdiff
Fix compiler warnings.
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 25 Mar 2012 12:58:14 +0000 (13:58 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 25 Mar 2012 12:58:14 +0000 (13:58 +0100)
src/multicast_device.c

index 879eb663d3a5ef0e553e40ab142006e98ff55ee0..08d44d4173ffe4b18ed5997f95fe05b8056f1ff7 100644 (file)
@@ -99,16 +99,16 @@ static bool setup_device(void) {
                        memcpy(&in, ai->ai_addr, sizeof in);
                        mreq.imr_multiaddr.s_addr = in.sin_addr.s_addr;
                        mreq.imr_interface.s_addr = htonl(INADDR_ANY);
-                       if(setsockopt(device_fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof mreq)) {
+                       if(setsockopt(device_fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&mreq, sizeof mreq)) {
                                logger(LOG_ERR, "Cannot join multicast group %s %s: %s", host, port, sockstrerror(sockerrno));
                                closesocket(device_fd);
                                return false;
                        }
 #ifdef IP_MULTICAST_LOOP
-                       setsockopt(device_fd, IPPROTO_IP, IP_MULTICAST_LOOP, &one, sizeof one);
+                       setsockopt(device_fd, IPPROTO_IP, IP_MULTICAST_LOOP, (const void *)&one, sizeof one);
 #endif
 #ifdef IP_MULTICAST_TTL
-                       setsockopt(device_fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof ttl);
+                       setsockopt(device_fd, IPPROTO_IP, IP_MULTICAST_TTL, (void *)&ttl, sizeof ttl);
 #endif
                } break;
 #endif
@@ -120,16 +120,16 @@ static bool setup_device(void) {
                        memcpy(&in6, ai->ai_addr, sizeof in6);
                        memcpy(&mreq.ipv6mr_multiaddr, &in6.sin6_addr, sizeof mreq.ipv6mr_multiaddr);
                        mreq.ipv6mr_interface = in6.sin6_scope_id;
-                       if(setsockopt(device_fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof mreq)) {
+                       if(setsockopt(device_fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, (void *)&mreq, sizeof mreq)) {
                                logger(LOG_ERR, "Cannot join multicast group %s %s: %s", host, port, sockstrerror(sockerrno));
                                closesocket(device_fd);
                                return false;
                        }
 #ifdef IPV6_MULTICAST_LOOP
-                       setsockopt(device_fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &one, sizeof one);
+                       setsockopt(device_fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, (const void *)&one, sizeof one);
 #endif
 #ifdef IPV6_MULTICAST_HOPS
-                       setsockopt(device_fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &ttl, sizeof ttl);
+                       setsockopt(device_fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (void *)&ttl, sizeof ttl);
 #endif
                } break;
 #endif