You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by mt...@apache.org on 2012/04/04 15:51:52 UTC
svn commit: r1309386 - in /apr/apr/branches/1.4.x: CHANGES
network_io/unix/multicast.c
Author: mturk
Date: Wed Apr 4 13:51:52 2012
New Revision: 1309386
URL: http://svn.apache.org/viewvc?rev=1309386&view=rev
Log:
Backport fix for apr_mcast_hops returning EINVAL from trunk
Modified:
apr/apr/branches/1.4.x/CHANGES
apr/apr/branches/1.4.x/network_io/unix/multicast.c
Modified: apr/apr/branches/1.4.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/CHANGES?rev=1309386&r1=1309385&r2=1309386&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.4.x/CHANGES [utf-8] Wed Apr 4 13:51:52 2012
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes for APR 1.4.7
+ *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte
+ instead integer for setsockopt. [Mladen Turk]
+
*) Windows: Fix compile-time checks for 64-bit builds, resolving a
crash in httpd's mod_rewrite. PR 49155. [<anindyabaruah gmail.com>]
Modified: apr/apr/branches/1.4.x/network_io/unix/multicast.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/network_io/unix/multicast.c?rev=1309386&r1=1309385&r2=1309386&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/network_io/unix/multicast.c (original)
+++ apr/apr/branches/1.4.x/network_io/unix/multicast.c Wed Apr 4 13:51:52 2012
@@ -194,7 +194,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;
@@ -205,24 +205,19 @@ 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) {
- 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;
}
}