Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 46F0E9B29 for ; Wed, 4 Apr 2012 13:52:16 +0000 (UTC) Received: (qmail 11151 invoked by uid 500); 4 Apr 2012 13:52:16 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 11060 invoked by uid 500); 4 Apr 2012 13:52:16 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 11051 invoked by uid 99); 4 Apr 2012 13:52:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2012 13:52:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_FRT_STOCK2 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2012 13:52:13 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A656C238899C for ; Wed, 4 Apr 2012 13:51:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1309386 - in /apr/apr/branches/1.4.x: CHANGES network_io/unix/multicast.c Date: Wed, 04 Apr 2012 13:51:52 -0000 To: commits@apr.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120404135152.A656C238899C@eris.apache.org> 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. [] 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; } }