--------------------- PatchSet 9695 Date: 2007/07/01 06:06:08 Author: amosjeffries Branch: ipv6 Tag: (none) Log: part 3 - Fix (some) compile errors. Members: src/access_log.c:1.5.2.8->1.5.2.9 src/acl.c:1.4.6.15->1.4.6.16 Index: squid/src/access_log.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/access_log.c,v retrieving revision 1.5.2.8 retrieving revision 1.5.2.9 diff -u -r1.5.2.8 -r1.5.2.9 --- squid/src/access_log.c 1 Jul 2007 05:44:17 -0000 1.5.2.8 +++ squid/src/access_log.c 1 Jul 2007 06:06:08 -0000 1.5.2.9 @@ -1,6 +1,6 @@ /* - * $Id: access_log.c,v 1.5.2.8 2007/07/01 05:44:17 amosjeffries Exp $ + * $Id: access_log.c,v 1.5.2.9 2007/07/01 06:06:08 amosjeffries Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -458,7 +458,7 @@ out = fmt->data.string; break; case LFT_CLIENT_IP_ADDRESS: - getnameinfo(&al->cache.caddr, SOCKLEN(&al->cache.caddr), caddr, 80, + getnameinfo((struct sockaddr *)&al->cache.caddr, SOCKLEN(&al->cache.caddr), caddr, 80, (char *)NULL, 0, NI_NUMERICHOST); out = caddr; break; @@ -466,7 +466,7 @@ case LFT_CLIENT_FQDN: out = fqdncache_gethostbyaddr((struct sockaddr *)&al->cache.caddr, FQDN_LOOKUP_IF_MISS); if (!out) { - getnameinfo(&al->cache.caddr, SOCKLEN(&al->cache.caddr), caddr, 80, + getnameinfo((struct sockaddr *)&al->cache.caddr, SOCKLEN(&al->cache.caddr), caddr, 80, (char *)NULL, 0, NI_NUMERICHOST); out = caddr; } @@ -485,14 +485,14 @@ out = al->hier.host; break; case LFT_OUTGOING_IP: - out = xstrdup(inet_ntoa(al->cache.out_ip)); + out = xstrdup(sockaddr_ntoa((struct sockaddr *)&al->cache.out_ip)); break; /* case LFT_SERVER_PORT: */ case LFT_LOCAL_IP: if (al->request) { - getnameinfo(&al->request->my_addr, + getnameinfo((struct sockaddr *)&al->request->my_addr, SOCKLEN(&al->request->my_addr), caddr, 80, (char *)NULL, 0, NI_NUMERICHOST); out = caddr; @@ -1036,7 +1036,7 @@ if (Config.onoff.log_fqdn) client = fqdncache_gethostbyaddr((struct sockaddr *)&al->cache.caddr, FQDN_LOOKUP_IF_MISS); if (client == NULL) { - getnameinfo(&al->cache.caddr, SOCKLEN(&al->cache.caddr), caddr, 80, + getnameinfo((struct sockaddr *)&al->cache.caddr, SOCKLEN(&al->cache.caddr), caddr, 80, (char *)NULL, 0, NI_NUMERICHOST); client = caddr; } @@ -1098,9 +1098,9 @@ char *user1 = NULL, *user2 = NULL; char caddr[80]; if (Config.onoff.log_fqdn) - client = fqdncache_gethostbyaddr(&al->cache.caddr, FQDN_LOOKUP_IF_MISS); + client = fqdncache_gethostbyaddr((struct sockaddr *)&al->cache.caddr, FQDN_LOOKUP_IF_MISS); if (client == NULL) { - getnameinfo(&al->cache.caddr, SOCKLEN(&al->cache.caddr), caddr, 80, + getnameinfo((struct sockaddr *)&al->cache.caddr, SOCKLEN(&al->cache.caddr), caddr, 80, (char *)NULL, 0, NI_NUMERICHOST); client = caddr; } Index: squid/src/acl.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/acl.c,v retrieving revision 1.4.6.15 retrieving revision 1.4.6.16 diff -u -r1.4.6.15 -r1.4.6.16 --- squid/src/acl.c 1 Jul 2007 05:44:18 -0000 1.4.6.15 +++ squid/src/acl.c 1 Jul 2007 06:06:09 -0000 1.4.6.16 @@ -1,6 +1,6 @@ /* - * $Id: acl.c,v 1.4.6.15 2007/07/01 05:44:18 amosjeffries Exp $ + * $Id: acl.c,v 1.4.6.16 2007/07/01 06:06:09 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -1707,7 +1707,7 @@ } /* get authed here */ /* Note: this fills in checklist->auth_user_request when applicable (auth incomplete) */ - switch (authenticateTryToAuthenticateAndSetAuthUser(&checklist->auth_user_request, headertype, checklist->request, checklist->conn, &checklist->src_addr)) { + switch (authenticateTryToAuthenticateAndSetAuthUser(&checklist->auth_user_request, headertype, checklist->request, checklist->conn, (struct sockaddr *)&checklist->src_addr)) { case AUTH_ACL_CANNOT_AUTHENTICATE: debug(28, 4) ("aclMatchAcl: returning 0 user authenticated but not authorised.\n"); return 0; @@ -1810,7 +1810,7 @@ return aclMatchDomainList(&ae->data, fqdn); if (checklist->state[ACL_DST_DOMAIN] == ACL_LOOKUP_NONE) { debug(28, 3) ("aclMatchAcl: Can't yet compare '%s' ACL for '%s'\n", - ae->name, sockaddr_ntoa(&ia->in_addrs[0])); + ae->name, sockaddr_ntoa((struct sockaddr *)&ia->in_addrs[0])); checklist->state[ACL_DST_DOMAIN] = ACL_LOOKUP_NEEDED; return 0; } @@ -1838,7 +1838,7 @@ return aclMatchRegex(ae->data, fqdn); if (checklist->state[ACL_DST_DOMAIN] == ACL_LOOKUP_NONE) { debug(28, 3) ("aclMatchAcl: Can't yet compare '%s' ACL for '%s'\n", - ae->name, sockaddr_ntoa(&ia->in_addrs[0])); + ae->name, sockaddr_ntoa((struct sockaddr *)&ia->in_addrs[0])); checklist->state[ACL_DST_DOMAIN] = ACL_LOOKUP_NEEDED; return 0; } @@ -1850,7 +1850,7 @@ return aclMatchRegex(ae->data, fqdn); } else if (checklist->state[ACL_SRC_DOMAIN] == ACL_LOOKUP_NONE) { debug(28, 3) ("aclMatchAcl: Can't yet compare '%s' ACL for '%s'\n", - ae->name, sockaddr_ntoa(&checklist->src_addr)); + ae->name, sockaddr_ntoa((struct sockaddr *)&checklist->src_addr)); checklist->state[ACL_SRC_DOMAIN] = ACL_LOOKUP_NEEDED; return 0; } @@ -1952,13 +1952,13 @@ /* NOTREACHED */ #endif case ACL_SRC_ASN: - return asnMatchIp(ae->data, &checklist->src_addr); + return asnMatchIp(ae->data, (struct sockaddr *)&checklist->src_addr); /* NOTREACHED */ case ACL_DST_ASN: ia = ipcache_gethostbyname(r->host, IP_LOOKUP_IF_MISS); if (ia) { for (k = 0; k < (int) ia->count; k++) { - if (asnMatchIp(ae->data, &ia->in_addrs[k])) + if (asnMatchIp(ae->data, (struct sockaddr *)&ia->in_addrs[k])) return 1; } return 0; @@ -1967,13 +1967,13 @@ ae->name, r->host); checklist->state[ACL_DST_ASN] = ACL_LOOKUP_NEEDED; } else { - return asnMatchIp(ae->data, &no_addr); + return asnMatchIp(ae->data, (struct sockaddr *)&no_addr); } return 0; /* NOTREACHED */ #if USE_ARP_ACL case ACL_SRC_ARP: - return aclMatchArp(&ae->data, checklist->src_addr); + return aclMatchArp(&ae->data, (struct sockaddr *)&checklist->src_addr); /* NOTREACHED */ #endif case ACL_REQ_MIME_TYPE: @@ -2752,7 +2752,7 @@ else if (masklen > 0) { invmasklen = 32 - masklen; debug(28, 3) ("aclIpNetworkCompare2: %s vs %s,\n", - sockaddr_ntoa(&p->addr1), sockaddr_ntoa(&q->addr1)); + sockaddr_ntoa((struct sockaddr *)&p->addr1), sockaddr_ntoa((struct sockaddr *)&q->addr1)); debug(28, 3) ("aclIpNetworkCompare2: %x/%d (%x) vs %x\n", IN6_NTOHL_N(&A, i), masklen, IN6_NTOHL_N(&A, i) & (0xffffffff << invmasklen), @@ -2795,8 +2795,8 @@ if (ret == 0) { char buf_n1[100]; char buf_n2[100]; - getnameinfo(&n1->addr1, SOCKLEN(&n1->addr1), &buf_n1, 100, NULL, 0, NI_NUMERICHOST); - getnameinfo(&n2->addr1, SOCKLEN(&n2->addr1), &buf_n2, 100, NULL, 0, NI_NUMERICHOST); + getnameinfo((struct sockaddr *)&n1->addr1, SOCKLEN(&n1->addr1), &buf_n1, 100, NULL, 0, NI_NUMERICHOST); + getnameinfo((struct sockaddr *)&n2->addr1, SOCKLEN(&n2->addr1), &buf_n2, 100, NULL, 0, NI_NUMERICHOST); debug(28, 0) ("WARNING: '%s' is a subnetwork of " "'%s'\n", buf_n1, buf_n2); debug(28, 0) ("WARNING: because of this '%s' is ignored " @@ -2851,10 +2851,10 @@ MemBuf mb; wordlist **W = state; memBufDefInit(&mb); - memBufPrintf(&mb, "%s", sockaddr_ntoa(&ip->addr1)); + memBufPrintf(&mb, "%s", sockaddr_ntoa((struct sockaddr *)&ip->addr1)); /* if (ip->addr2.s_addr != any_addr.s_addr) - memBufPrintf(&mb, "-%s", sockaddr_ntoa(&ip->addr2)); + memBufPrintf(&mb, "-%s", sockaddr_ntoa((struct sockaddr *)&ip->addr2)); */ memBufPrintf(&mb, "/%d", ip->masklen); wordlistAdd(W, mb.buf);