--------------------- PatchSet 1410 Date: 2005/05/22 14:49:41 Author: rmartinez Branch: squid3-ipv6 Tag: (none) Log: gethostbyname/GETHOSTBYNAME. Second is defined to filter depending on addess' famly. Module ready unless error. (SNMP add-in not yet) Members: src/ipcache.cc:1.9.2.6->1.9.2.7 Index: squid3/src/ipcache.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ipcache.cc,v retrieving revision 1.9.2.6 retrieving revision 1.9.2.7 diff -u -r1.9.2.6 -r1.9.2.7 --- squid3/src/ipcache.cc 5 May 2005 09:21:44 -0000 1.9.2.6 +++ squid3/src/ipcache.cc 22 May 2005 14:49:41 -0000 1.9.2.7 @@ -1,6 +1,6 @@ /* - * $Id: ipcache.cc,v 1.9.2.6 2005/05/05 09:21:44 rmartinez Exp $ + * $Id: ipcache.cc,v 1.9.2.7 2005/05/22 14:49:41 rmartinez Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -119,7 +119,7 @@ return 1; for (; w; w = w->next) { - if (gethostbyname(w->key) != NULL) + if (GETHOSTBYNAME(w->key) != NULL) return 1; } @@ -338,7 +338,7 @@ i->addrs.bad_mask = (unsigned char *)xcalloc(ipcount, sizeof(unsigned char)); for (j = 0, k = 0; k < ipcount; k++) { - if (safe_inet_addr(A[k], &i->addrs.in_addrs[j])) + if (SAFE_INET_ADDR(A[k], &i->addrs.in_addrs[j])) j++; else debug(14, 1) ("ipcacheParse: Invalid IP address '%s' in response to '%s'\n", A[k], name); @@ -639,8 +639,8 @@ (int) i->addrs.badcount); for (k = 0; k < (int) i->addrs.count; k++) { - storeAppendPrintf(sentry, " %15s-%3s", INET_NTOA(i->addrs.in_addrs[k]), - i->addrs.bad_mask[k] ? "BAD" : "OK "); + storeAppendPrintf(sentry, " %45s-%3s", INET_NTOA(i->addrs.in_addrs[k]), + i->addrs.bad_mask[k] ? "BAD" : "OK "); /* Max. between 15 IPv4 / 45 IPv6 address length */ } storeAppendPrintf(sentry, "\n"); @@ -910,18 +910,19 @@ struct IN_ADDR ip; if (!SAFE_INET_ADDR(ipaddr, &ip)) { -#ifdef INET6 - debug(14, 1) ("ipcacheAddEntryFromHosts: Bad IP address '%s'\n", - ipaddr); -#else +#ifndef INET6 if (strchr(ipaddr, ':') && strspn(ipaddr, "0123456789abcdefABCDEF:") == strlen(ipaddr)) { debug(14, 3) ("ipcacheAddEntryFromHosts: Skipping IPv6 address '%s'\n", ipaddr); } else { debug(14, 1) ("ipcacheAddEntryFromHosts: Bad IP address '%s'\n", ipaddr); } +#else + debug(14, 1) ("ipcacheAddEntryFromHosts: Bad IP address '%s'\n", + ipaddr); #endif + return 1; }