--------------------- PatchSet 4212 Date: 2007/04/09 12:06:03 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Fixed ACLIP splay tree algorithm broken by old conversion code. Members: include/IPAddress.h:1.1.2.12->1.1.2.13 src/ACLIP.cc:1.8.2.20->1.8.2.21 Index: squid3/include/IPAddress.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/include/Attic/IPAddress.h,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -u -r1.1.2.12 -r1.1.2.13 --- squid3/include/IPAddress.h 7 Apr 2007 13:06:43 -0000 1.1.2.12 +++ squid3/include/IPAddress.h 9 Apr 2007 12:06:03 -0000 1.1.2.13 @@ -1,6 +1,6 @@ /* - * $Id: IPAddress.h,v 1.1.2.12 2007/04/07 13:06:43 amosjeffries Exp $ + * $Id: IPAddress.h,v 1.1.2.13 2007/04/09 12:06:03 amosjeffries Exp $ * * DEBUG: section 14 IP Storage and Handling * AUTHOR: Amos Jeffries @@ -253,6 +253,13 @@ #endif + /** Test how two IP relate to each other. + * \retval 0 IP are equal + * \retval 1 IP rhs is greater (numerically) than that stored. + * \retval -1 IP rhs is less (numerically) than that stored. + */ + int matchIPAddr(const IPAddress &rhs) const; + public: /* FIXME: When C => C++ conversion is done will be fully private. * Legacy Transition Methods @@ -274,7 +281,6 @@ #endif private: - int matchIPAddr(const IPAddress &rhs) const; /* Conversion for dual-type internals */ bool GetReverseString4(char buf[], struct in_addr &) const; Index: squid3/src/ACLIP.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLIP.cc,v retrieving revision 1.8.2.20 retrieving revision 1.8.2.21 diff -u -r1.8.2.20 -r1.8.2.21 --- squid3/src/ACLIP.cc 1 Apr 2007 12:02:29 -0000 1.8.2.20 +++ squid3/src/ACLIP.cc 9 Apr 2007 12:06:08 -0000 1.8.2.21 @@ -1,5 +1,5 @@ /* - * $Id: ACLIP.cc,v 1.8.2.20 2007/04/01 12:02:29 amosjeffries Exp $ + * $Id: ACLIP.cc,v 1.8.2.21 2007/04/09 12:06:08 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -131,14 +131,16 @@ /* apply netmask */ A.ApplyMask(q->mask); - if (q->addr2.IsAnyAddr()) { /* single address check */ - return (A == q->addr1); - } else { /* range address check */ + if (q->addr2.IsAnyAddr()) { /* single address check */ + + return A.matchIPAddr( q->addr1 ); + + } else { /* range address check */ if ( (A >= q->addr1) && (A <= q->addr2) ) return 0; /* valid */ else - return -1; /* outside of range, 'less than' */ + return A.matchIPAddr( q->addr1 ); /* outside of range, 'less than' */ } }