--------------------- PatchSet 4421 Date: 2007/04/30 13:27:36 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: More conversion rollout Members: src/ACLDestinationDomain.cc:1.7.6.8->1.7.6.9 src/ACLSourceDomain.cc:1.3.12.6->1.3.12.7 src/access_log.cc:1.23.4.10->1.23.4.11 src/client_db.cc:1.5.4.8->1.5.4.9 src/client_side.cc:1.68.2.17->1.68.2.18 src/dns_internal.cc:1.15.6.16->1.15.6.17 src/fqdncache.cc:1.9.2.14->1.9.2.15 src/protos.h:1.48.4.15->1.48.4.16 src/redirect.cc:1.15.4.6->1.15.4.7 Index: squid3/src/ACLDestinationDomain.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLDestinationDomain.cc,v retrieving revision 1.7.6.8 retrieving revision 1.7.6.9 diff -u -r1.7.6.8 -r1.7.6.9 --- squid3/src/ACLDestinationDomain.cc 29 Apr 2007 03:01:35 -0000 1.7.6.8 +++ squid3/src/ACLDestinationDomain.cc 30 Apr 2007 13:27:36 -0000 1.7.6.9 @@ -1,5 +1,5 @@ /* - * $Id: ACLDestinationDomain.cc,v 1.7.6.8 2007/04/29 03:01:35 amosjeffries Exp $ + * $Id: ACLDestinationDomain.cc,v 1.7.6.9 2007/04/30 13:27:36 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -86,7 +86,8 @@ const char *fqdn = NULL; - fqdn = fqdncache_gethostbyaddr(ia->in_addrs[0], FQDN_LOOKUP_IF_MISS); +/* FIXME INET6 : drop temp conversion */ IPAddress tmp(ia->in_addrs[0]); + fqdn = fqdncache_gethostbyaddr(tmp, FQDN_LOOKUP_IF_MISS); if (fqdn) { return data->match(fqdn); Index: squid3/src/ACLSourceDomain.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLSourceDomain.cc,v retrieving revision 1.3.12.6 retrieving revision 1.3.12.7 diff -u -r1.3.12.6 -r1.3.12.7 --- squid3/src/ACLSourceDomain.cc 29 Apr 2007 05:47:32 -0000 1.3.12.6 +++ squid3/src/ACLSourceDomain.cc 30 Apr 2007 13:27:36 -0000 1.3.12.7 @@ -1,5 +1,5 @@ /* - * $Id: ACLSourceDomain.cc,v 1.3.12.6 2007/04/29 05:47:32 amosjeffries Exp $ + * $Id: ACLSourceDomain.cc,v 1.3.12.7 2007/04/30 13:27:36 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -76,8 +76,8 @@ ACLSourceDomainStrategy::match (ACLData * &data, ACLChecklist *checklist) { const char *fqdn = NULL; - /* FIXME INET6 : drop temp conversion */ struct IN_ADDR tmp; checklist->src_addr.GetInAddr(tmp); - fqdn = fqdncache_gethostbyaddr(tmp, FQDN_LOOKUP_IF_MISS); +// /* FIXME INET6 : drop temp conversion */ struct IN_ADDR tmp; checklist->src_addr.GetInAddr(tmp); + fqdn = fqdncache_gethostbyaddr(checklist->src_addr, FQDN_LOOKUP_IF_MISS); if (fqdn) { return data->match(fqdn); Index: squid3/src/access_log.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/access_log.cc,v retrieving revision 1.23.4.10 retrieving revision 1.23.4.11 diff -u -r1.23.4.10 -r1.23.4.11 --- squid3/src/access_log.cc 29 Apr 2007 03:01:36 -0000 1.23.4.10 +++ squid3/src/access_log.cc 30 Apr 2007 13:27:36 -0000 1.23.4.11 @@ -1,6 +1,6 @@ /* - * $Id: access_log.cc,v 1.23.4.10 2007/04/29 03:01:36 amosjeffries Exp $ + * $Id: access_log.cc,v 1.23.4.11 2007/04/30 13:27:36 amosjeffries Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -545,8 +545,10 @@ break; case LFT_CLIENT_FQDN: - out = fqdncache_gethostbyaddr(al->cache.caddr, FQDN_LOOKUP_IF_MISS); - +{ +/* FIXME INET6 : drop temp conversion */ IPAddress tmp(al->cache.caddr); + out = fqdncache_gethostbyaddr(tmp, FQDN_LOOKUP_IF_MISS); +} if (!out) out = inet_ntoa(al->cache.caddr); @@ -1255,8 +1257,9 @@ const char *client = NULL; const char *user = NULL; - if (Config.onoff.log_fqdn) { - client = fqdncache_gethostbyaddr(al->cache.caddr, FQDN_LOOKUP_IF_MISS); + if (Config.onoff.log_fqdn) { +/* FIXME INET6 : drop temp conversion */ IPAddress tmp_addr(al->cache.caddr); + client = fqdncache_gethostbyaddr(tmp_addr, FQDN_LOOKUP_IF_MISS); } if (client == NULL) { @@ -1331,7 +1334,8 @@ char *user1 = NULL, *user2 = NULL; if (Config.onoff.log_fqdn) { - client = fqdncache_gethostbyaddr(al->cache.caddr, 0); +/* FIXME INET6 : drop temp conversion */ IPAddress tmp_addr(al->cache.caddr); + client = fqdncache_gethostbyaddr(tmp_addr, 0); } if (client == NULL) { Index: squid3/src/client_db.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_db.cc,v retrieving revision 1.5.4.8 retrieving revision 1.5.4.9 diff -u -r1.5.4.8 -r1.5.4.9 --- squid3/src/client_db.cc 29 Apr 2007 03:01:37 -0000 1.5.4.8 +++ squid3/src/client_db.cc 30 Apr 2007 13:27:36 -0000 1.5.4.9 @@ -1,6 +1,6 @@ /* - * $Id: client_db.cc,v 1.5.4.8 2007/04/29 03:01:37 amosjeffries Exp $ + * $Id: client_db.cc,v 1.5.4.9 2007/04/30 13:27:36 amosjeffries Exp $ * * DEBUG: section 0 Client Database * AUTHOR: Duane Wessels @@ -249,7 +249,8 @@ while ((c = (ClientInfo *) hash_next(client_table))) { storeAppendPrintf(sentry, "Address: %s\n", hashKeyStr(&c->hash)); - storeAppendPrintf(sentry, "Name: %s\n", fqdnFromAddr(c->addr)); +/* FIXME INET6 : dropp temp conversion*/ IPAddress tmpipa(c->addr); + storeAppendPrintf(sentry, "Name: %s\n", fqdnFromAddr(tmpipa)); storeAppendPrintf(sentry, "Currently established connections: %d\n", c->n_established); storeAppendPrintf(sentry, " ICP Requests %d\n", Index: squid3/src/client_side.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side.cc,v retrieving revision 1.68.2.17 retrieving revision 1.68.2.18 diff -u -r1.68.2.17 -r1.68.2.18 --- squid3/src/client_side.cc 29 Apr 2007 14:18:23 -0000 1.68.2.17 +++ squid3/src/client_side.cc 30 Apr 2007 13:27:36 -0000 1.68.2.18 @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.68.2.17 2007/04/29 14:18:23 amosjeffries Exp $ + * $Id: client_side.cc,v 1.68.2.18 2007/04/30 13:27:36 amosjeffries Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2742,7 +2742,10 @@ comm_add_close_handler(newfd, connStateFree, connState); if (Config.onoff.log_fqdn) - fqdncache_gethostbyaddr(details->peer.sin_addr, FQDN_LOOKUP_IF_MISS); +{ +/* FIXME INET6 : drop temp conversion */ IPAddress tmp(details->peer); + fqdncache_gethostbyaddr(tmp, FQDN_LOOKUP_IF_MISS); +} commSetTimeout(newfd, Config.Timeout.request, requestTimeout, connState); Index: squid3/src/dns_internal.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/dns_internal.cc,v retrieving revision 1.15.6.16 retrieving revision 1.15.6.17 diff -u -r1.15.6.16 -r1.15.6.17 --- squid3/src/dns_internal.cc 29 Apr 2007 14:18:23 -0000 1.15.6.16 +++ squid3/src/dns_internal.cc 30 Apr 2007 13:27:37 -0000 1.15.6.17 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.15.6.16 2007/04/29 14:18:23 amosjeffries Exp $ + * $Id: dns_internal.cc,v 1.15.6.17 2007/04/30 13:27:37 amosjeffries Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -220,10 +220,8 @@ assert(nns < nns_alloc); A.SetPort(NS_DEFAULTPORT); -//* FIXME INET6 : remove temporary conversion: final version: nameservers[nns].S = A; */ -// A.GetSockAddr(nameservers[nns].S); nameservers[nns].S = A; - debugs(78, 3, "idnsAddNameserver: Added nameserver #" << nns << ": " << A ); + debugs(78, 3, "idnsAddNameserver: Added nameserver #" << nns << " (" << A << ")"); nns++; } Index: squid3/src/fqdncache.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fqdncache.cc,v retrieving revision 1.9.2.14 retrieving revision 1.9.2.15 diff -u -r1.9.2.14 -r1.9.2.15 --- squid3/src/fqdncache.cc 29 Apr 2007 05:47:32 -0000 1.9.2.14 +++ squid3/src/fqdncache.cc 30 Apr 2007 13:27:37 -0000 1.9.2.15 @@ -1,6 +1,6 @@ /* - * $Id: fqdncache.cc,v 1.9.2.14 2007/04/29 05:47:32 amosjeffries Exp $ + * $Id: fqdncache.cc,v 1.9.2.15 2007/04/30 13:27:37 amosjeffries Exp $ * * DEBUG: section 35 FQDN Cache * AUTHOR: Harvest Derived @@ -542,13 +542,13 @@ } const char * -fqdncache_gethostbyaddr(struct IN_ADDR addr, int flags) +fqdncache_gethostbyaddr(IPAddress &addr, int flags) { - char *name = inet_ntoa(addr); + char name[MAX_IPSTRLEN]; fqdncache_entry *f = NULL; - struct IN_ADDR ip; - assert(name); + assert(!addr.IsAnyAddr() && !addr.IsNoAddr()); + addr.NtoA(name,MAX_IPSTRLEN); FqdncacheStats.requests++; f = fqdncache_get(name); @@ -574,18 +574,11 @@ dns_error_message = NULL; - /* check if it's already a FQDN address in text form. */ - - if (!safe_inet_addr(name, &ip)) - return name; - FqdncacheStats.misses++; if (flags & FQDN_LOOKUP_IF_MISS) { - /* FIXME INET6 : drop temp conversion */ IPAddress tmp; - fqdncache_nbgethostbyaddr(tmp, dummy_handler, NULL); - /* FIXME INET6 : drop temp conversion */ tmp.GetInAddr(addr); + fqdncache_nbgethostbyaddr(addr, dummy_handler, NULL); } return NULL; @@ -650,7 +643,7 @@ } const char * -fqdnFromAddr(struct IN_ADDR addr) +fqdnFromAddr(IPAddress &addr) { const char *n; static char buf[MAX_IPSTRLEN]; @@ -658,8 +651,7 @@ if (Config.onoff.log_fqdn && (n = fqdncache_gethostbyaddr(addr, 0))) return n; -/* FIXME INET6 : drop temp conversion */ IPAddress tmp(addr); - tmp.NtoA(buf, MAX_IPSTRLEN); + addr.NtoA(buf, MAX_IPSTRLEN); return buf; } Index: squid3/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/protos.h,v retrieving revision 1.48.4.15 retrieving revision 1.48.4.16 diff -u -r1.48.4.15 -r1.48.4.16 --- squid3/src/protos.h 25 Apr 2007 12:53:44 -0000 1.48.4.15 +++ squid3/src/protos.h 30 Apr 2007 13:27:37 -0000 1.48.4.16 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.48.4.15 2007/04/25 12:53:44 amosjeffries Exp $ + * $Id: protos.h,v 1.48.4.16 2007/04/30 13:27:37 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -166,13 +166,13 @@ SQUIDCEXTERN void fqdncache_nbgethostbyaddr(IPAddress &, FQDNH *, void *); -SQUIDCEXTERN const char *fqdncache_gethostbyaddr(struct IN_ADDR, int flags); +SQUIDCEXTERN const char *fqdncache_gethostbyaddr(IPAddress &, int flags); SQUIDCEXTERN void fqdncache_init(void); extern void fqdncacheRegisterWithCacheManager(CacheManager & manager); SQUIDCEXTERN void fqdnStats(StoreEntry *); SQUIDCEXTERN void fqdncacheReleaseInvalid(const char *); -SQUIDCEXTERN const char *fqdnFromAddr(struct IN_ADDR); +SQUIDCEXTERN const char *fqdnFromAddr(IPAddress &); SQUIDCEXTERN int fqdncacheQueueDrain(void); SQUIDCEXTERN void fqdncacheFreeMemory(void); SQUIDCEXTERN void fqdncache_restart(void); Index: squid3/src/redirect.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/redirect.cc,v retrieving revision 1.15.4.6 retrieving revision 1.15.4.7 diff -u -r1.15.4.6 -r1.15.4.7 --- squid3/src/redirect.cc 29 Apr 2007 03:01:39 -0000 1.15.4.6 +++ squid3/src/redirect.cc 30 Apr 2007 13:27:37 -0000 1.15.4.7 @@ -1,6 +1,6 @@ /* - * $Id: redirect.cc,v 1.15.4.6 2007/04/29 03:01:39 amosjeffries Exp $ + * $Id: redirect.cc,v 1.15.4.7 2007/04/30 13:27:37 amosjeffries Exp $ * * DEBUG: section 61 Redirector * AUTHOR: Duane Wessels @@ -159,7 +159,8 @@ r->data = cbdataReference(data); - if ((fqdn = fqdncache_gethostbyaddr(r->client_addr, 0)) == NULL) +/* FIXME INET6 : drop temp conversion */ IPAddress tmpaddr(r->client_addr); + if ((fqdn = fqdncache_gethostbyaddr(tmpaddr, 0)) == NULL) fqdn = dash_str; snprintf(buf, 8192, "%s %s/%s %s %s\n",