Author: mturk
Date: Wed Apr 4 13:33:26 2012
New Revision: 1309376
URL: http://svn.apache.org/viewvc?rev=1309376&view=rev
Log:
Make sure the IPv4 setsockopt also uses 4 byte optval type.
Modified:
apr/apr/trunk/network_io/unix/multicast.c
Modified: apr/apr/trunk/network_io/unix/multicast.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/multicast.c?rev=1309376&r1=1309375&r2=1309376&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/multicast.c (original)
+++ apr/apr/trunk/network_io/unix/multicast.c Wed Apr 4 13:33:26 2012
@@ -197,7 +197,7 @@ static apr_status_t do_mcast(int type, a
}
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;
@@ -209,15 +209,13 @@ static apr_status_t do_mcast_opt(int typ
}
#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) {
+ (const void *) &value, sizeof(value)) == -1) {
rv = errno;
}
}
else if (sock_is_ipv6(sock)) {
- unsigned int hopsopt = value;
if (type == IP_MULTICAST_TTL) {
type = IPV6_MULTICAST_HOPS;
}
@@ -226,7 +224,7 @@ static apr_status_t do_mcast_opt(int typ
}
if (setsockopt(sock->socketdes, IPPROTO_IPV6, type,
- (const void *) &hopsopt, sizeof(hopsopt)) == -1) {
+ (const void *) &value, sizeof(value)) == -1) {
rv = errno;
}
}
|