From: Guus Sliepen Date: Sun, 25 Mar 2012 12:58:14 +0000 (+0100) Subject: Fix compiler warnings. X-Git-Tag: import-tinc-1.1~385^2~7 X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=95968c67f9df9102ddbce5b7c8d34107989ad51a;p=meshlink Fix compiler warnings. --- diff --git a/src/multicast_device.c b/src/multicast_device.c index 879eb663..08d44d41 100644 --- a/src/multicast_device.c +++ b/src/multicast_device.c @@ -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