Browse Source

- fixed ipv6 multicast on non-linux OSes (linux is the only one using
IPV6_ADD_MEMBERSHIP, all the other use instead IPV6_JOIN_GROUP)

Andrei Pelinescu-Onciul 21 years ago
parent
commit
d3d1486e22
1 changed files with 4 additions and 1 deletions
  1. 4 1
      udp_server.c

+ 4 - 1
udp_server.c

@@ -254,8 +254,11 @@ static int setup_mcast_rcvr(int sock, union sockaddr_union* addr)
 		memcpy(&mreq6.ipv6mr_multiaddr, &addr->sin6.sin6_addr, 
 		       sizeof(struct in6_addr));
 		mreq6.ipv6mr_interface = 0;
-		
+#ifdef __OS_linux
 		if (setsockopt(sock, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq6,
+#else
+		if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq6,
+#endif
 			       sizeof(mreq6))==-1){
 			LOG(L_ERR, "ERROR: setup_mcast_rcvr: setsockopt:%s\n",
 			    strerror(errno));