--------------------- PatchSet 5495 Date: 2007/08/25 23:52:22 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Fix some more weirdness. valgrind located. Members: src/ACLIP.cc:1.8.2.42->1.8.2.43 Index: squid3/src/ACLIP.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLIP.cc,v retrieving revision 1.8.2.42 retrieving revision 1.8.2.43 diff -u -r1.8.2.42 -r1.8.2.43 --- squid3/src/ACLIP.cc 23 Aug 2007 08:35:25 -0000 1.8.2.42 +++ squid3/src/ACLIP.cc 25 Aug 2007 23:52:22 -0000 1.8.2.43 @@ -1,5 +1,5 @@ /* - * $Id: ACLIP.cc,v 1.8.2.42 2007/08/23 08:35:25 amosjeffries Exp $ + * $Id: ACLIP.cc,v 1.8.2.43 2007/08/25 23:52:22 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -300,11 +300,11 @@ /* * Note, must use plain xgetaddrinfo() here because at startup * ipcache hasn't been initialized - 8 TODO: offload this to one of the IPAddress lookups. + * TODO: offload this to one of the IPAddress lookups. */ debugs(28, 5, "aclIpParseIpData: Lookup Host/IP " << l_addr1); - struct addrinfo *hp = NULL, *x = NULL, *y = NULL; + struct addrinfo *hp = NULL, *x = NULL; struct addrinfo hints; IPAddress *prev_addr = NULL; @@ -321,6 +321,7 @@ if (hp == NULL) { debugs(28, 0, "aclIpParseIpData: Bad host/IP: '" << l_addr1 << "' in '" << t << "', flags=" << hints.ai_flags << " : (" << errcode << ") " << xgai_strerror(errcode) ); self_destruct(); + return NULL; } Q = &q; @@ -329,16 +330,10 @@ if ((r = *Q) == NULL) r = *Q = new acl_ip_data; - /* addrinfo operator in IPA will skip non-accepted results silently */ - /* to get all results tested, we must pull them individually and unlinked.*/ - y = x; - x = x->ai_next; - y->ai_next = NULL; - r->addr1 = *y; - y->ai_next = x; // re-link for clear later. - /* getaddrinfo given a host has a nasty tendency to return duplicate addr's */ /* BUT sorted fortunately, so we can drop most of them easily */ + r->addr1 = *x; + x = x->ai_next; if( prev_addr && r->addr1 == *prev_addr) { debugs(28, 3, "aclIpParseIpData: Duplicate host/IP: '" << r->addr1 << "' dropped."); delete r; @@ -348,8 +343,7 @@ else prev_addr = &r->addr1; - if( !r->addr1.IsAnyAddr() ) - debugs(28, 3, "aclIpParseIpData: Located host/IP: '" << r->addr1 << "'"); + debugs(28, 3, "aclIpParseIpData: Located host/IP: '" << r->addr1 << "'"); r->addr2.SetAnyAddr();