Author: jorton
Date: Tue Dec 11 12:06:43 2012
New Revision: 1420116
URL: http://svn.apache.org/viewvc?rev=1420116&view=rev
Log:
Merge 1405985 from trunk:
* network_io/unix/sockaddr.c (apr_ipsubnet_test): Fix false positive
when testing a v4 subnet against a v6 address.
* test/testipsub.c (test_interesting_subnets): Add test.
PR: 54047
Modified:
apr/apr/branches/1.4.x/ (props changed)
apr/apr/branches/1.4.x/CHANGES
apr/apr/branches/1.4.x/network_io/unix/sockaddr.c
apr/apr/branches/1.4.x/test/testipsub.c
Propchange: apr/apr/branches/1.4.x/
------------------------------------------------------------------------------
Merged /apr/apr/trunk:r1405985
Modified: apr/apr/branches/1.4.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/CHANGES?rev=1420116&r1=1420115&r2=1420116&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.4.x/CHANGES [utf-8] Tue Dec 11 12:06:43 2012
@@ -1,6 +1,12 @@
-*- coding: utf-8 -*-
Changes for APR 1.4.7
+ *) Remove unused code, fix strict C compliance bug in SHA-256
+ implementation. [Jan Kaluza <jkaluza redhat.com>]
+
+ *) Fix apr_ipsubnet_test() false positives when comparing IPv4
+ subnet representation against an IPv6 address. PR 54047. [Joe Orton]
+
*) apr_socket_accept_filter: Return success when trying to again set
the filter to the same value as before, avoiding an unhelpful
APR_EINVAL. PR 37863. [Jeff Trawick]
Modified: apr/apr/branches/1.4.x/network_io/unix/sockaddr.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/network_io/unix/sockaddr.c?rev=1420116&r1=1420115&r2=1420116&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/network_io/unix/sockaddr.c (original)
+++ apr/apr/branches/1.4.x/network_io/unix/sockaddr.c Tue Dec 11 12:06:43 2012
@@ -1028,7 +1028,7 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_i
/* XXX This line will segv on Win32 build with APR_HAVE_IPV6,
* but without the IPV6 drivers installed.
*/
- if (sa->sa.sin.sin_family == AF_INET) {
+ if (sa->family == AF_INET) {
if (ipsub->family == AF_INET &&
((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0]))
{
return 1;
@@ -1040,7 +1040,7 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_i
return 1;
}
}
- else {
+ else if (sa->family == AF_INET6 && ipsub->family == AF_INET6) {
apr_uint32_t *addr = (apr_uint32_t *)sa->ipaddr_ptr;
if ((addr[0] & ipsub->mask[0]) == ipsub->sub[0] &&
Modified: apr/apr/branches/1.4.x/test/testipsub.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/test/testipsub.c?rev=1420116&r1=1420115&r2=1420116&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/test/testipsub.c (original)
+++ apr/apr/branches/1.4.x/test/testipsub.c Tue Dec 11 12:06:43 2012
@@ -119,6 +119,7 @@ static void test_interesting_subnets(abt
,{"127", NULL, APR_INET, "127.0.0.1", "10.1.2.3"}
,{"127.0.0.1", "8", APR_INET, "127.0.0.1", "10.1.2.3"}
#if APR_HAVE_IPV6
+ ,{"38.0.0.0", "8", APR_INET6, "::ffff:38.1.1.1", "2600::1"}
/* PR 54047 */
,{"fe80::", "8", APR_INET6, "fe80::1", "ff01::1"}
,{"ff01::", "8", APR_INET6, "ff01::1", "fe80::1"}
,{"3FFE:8160::", "28", APR_INET6, "3ffE:816e:abcd:1234::1", "3ffe:8170::1"}
|