Blob Blame Raw

http://svn.apache.org/viewvc?view=revision&revision=1309386

--- apr-1.4.6/network_io/unix/multicast.c
+++ apr-1.4.6/network_io/unix/multicast.c
@@ -194,7 +194,7 @@
 }
 
 static apr_status_t do_mcast_opt(int type, apr_socket_t *sock,
-                                 apr_byte_t value)
+                                 apr_uint32_t value)
 {
     apr_status_t rv = APR_SUCCESS;
 
@@ -205,24 +205,19 @@
         }
     }
 #if APR_HAVE_IPV6
-    else if (sock_is_ipv6(sock) && type == IP_MULTICAST_LOOP) {
-        unsigned int loopopt = value;
-        type = IPV6_MULTICAST_LOOP;
-        if (setsockopt(sock->socketdes, IPPROTO_IPV6, type,
-                       (const void *) &loopopt, sizeof(loopopt)) == -1) {
-            rv = errno;
-        }
-    }
     else if (sock_is_ipv6(sock)) {
         if (type == IP_MULTICAST_TTL) {
             type = IPV6_MULTICAST_HOPS;
         }
+        else if (type == IP_MULTICAST_LOOP) {
+            type = IPV6_MULTICAST_LOOP;
+        }
         else {
             return APR_ENOTIMPL;
         }
 
         if (setsockopt(sock->socketdes, IPPROTO_IPV6, type,
-                       &value, sizeof(value)) == -1) {
+                       (const void *) &value, sizeof(value)) == -1) {
             rv = errno;
         }
     }