--------------------- PatchSet 5474 Date: 2007/08/22 08:25:00 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Fix Bug: mixed ACL with IPv4 and IPv6 addresses never matches IPv4. Members: lib/IPAddress.cc:1.1.2.67->1.1.2.68 Index: squid3/lib/IPAddress.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/lib/Attic/IPAddress.cc,v retrieving revision 1.1.2.67 retrieving revision 1.1.2.68 diff -u -r1.1.2.67 -r1.1.2.68 --- squid3/lib/IPAddress.cc 22 Aug 2007 02:27:04 -0000 1.1.2.67 +++ squid3/lib/IPAddress.cc 22 Aug 2007 08:25:00 -0000 1.1.2.68 @@ -1,5 +1,5 @@ /* - * $Id: IPAddress.cc,v 1.1.2.67 2007/08/22 02:27:04 amosjeffries Exp $ + * $Id: IPAddress.cc,v 1.1.2.68 2007/08/22 08:25:00 amosjeffries Exp $ * * DEBUG: section 14 IP Storage and Handling * AUTHOR: Amos Jeffries @@ -850,8 +850,9 @@ #endif // loop a byte-wise compare - - for(int i=sizeof(m_SocketAddr.sin6_addr)-1; i>=0 ; i--) { + // NP: match MUST be R-to-L : L-to-R produces inconsistent gt/lt results at varying CIDR + // expected difference on CIDR is gt/eq or lt/eq ONLY. + for(unsigned int i = 0 ; i < sizeof(m_SocketAddr.sin6_addr) ; i++) { if(l[i] < r[i]) return -1;