--------------------- PatchSet 9697 Date: 2007/07/01 08:34:22 Author: amosjeffries Branch: ipv6 Tag: (none) Log: Fix remaining compile errors for default configure options. Members: src/access_log.c:1.5.2.9->1.5.2.10 src/acl.c:1.4.6.17->1.4.6.18 src/cache_cf.c:1.4.2.12->1.4.2.13 src/client_side.c:1.7.2.11->1.7.2.12 src/comm.c:1.4.6.10->1.4.6.11 src/forward.c:1.4.6.8->1.4.6.9 src/icp_v2.c:1.3.6.6->1.3.6.7 src/ipcache.c:1.4.6.13->1.4.6.14 src/neighbors.c:1.5.4.9->1.5.4.10 src/protos.h:1.5.2.13->1.5.2.14 src/ssl.c:1.3.6.8->1.3.6.9 src/structs.h:1.7.2.11->1.7.2.12 src/tools.c:1.4.2.11->1.4.2.12 src/url.c:1.3.6.6->1.3.6.7 Index: squid/src/access_log.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/access_log.c,v retrieving revision 1.5.2.9 retrieving revision 1.5.2.10 diff -u -r1.5.2.9 -r1.5.2.10 --- squid/src/access_log.c 1 Jul 2007 06:06:08 -0000 1.5.2.9 +++ squid/src/access_log.c 1 Jul 2007 08:34:22 -0000 1.5.2.10 @@ -1,6 +1,6 @@ /* - * $Id: access_log.c,v 1.5.2.9 2007/07/01 06:06:08 amosjeffries Exp $ + * $Id: access_log.c,v 1.5.2.10 2007/07/01 08:34:22 amosjeffries Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -485,7 +485,7 @@ out = al->hier.host; break; case LFT_OUTGOING_IP: - out = xstrdup(sockaddr_ntoa((struct sockaddr *)&al->cache.out_ip)); + out = xstrdup(sockaddr_ntoa(&al->cache.out_ip)); break; /* case LFT_SERVER_PORT: */ Index: squid/src/acl.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/acl.c,v retrieving revision 1.4.6.17 retrieving revision 1.4.6.18 diff -u -r1.4.6.17 -r1.4.6.18 --- squid/src/acl.c 1 Jul 2007 06:11:53 -0000 1.4.6.17 +++ squid/src/acl.c 1 Jul 2007 08:34:23 -0000 1.4.6.18 @@ -1,6 +1,6 @@ /* - * $Id: acl.c,v 1.4.6.17 2007/07/01 06:11:53 amosjeffries Exp $ + * $Id: acl.c,v 1.4.6.18 2007/07/01 08:34:23 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -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((struct sockaddr *)&ia->in_addrs[0])); + ae->name, sockaddr_ntoa(&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((struct sockaddr *)&ia->in_addrs[0])); + ae->name, sockaddr_ntoa(&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((struct sockaddr *)&checklist->src_addr)); + ae->name, sockaddr_ntoa(&checklist->src_addr)); checklist->state[ACL_SRC_DOMAIN] = ACL_LOOKUP_NEEDED; return 0; } @@ -2374,7 +2374,17 @@ aclChecklistCacheInit(aclCheck_t * checklist) { request_t *request = checklist->request; - if (request != NULL && checklist->src_addr.s_addr == 0) { + struct sockaddr *A = (struct sockaddr*)&checklist->src_addr; + if( request != NULL && + ( + ( (checklist->src_addr.ss_family == AF_INET6) + && IN6_IS_ADDR_UNSPECIFIED( &((struct sockaddr_in6 *)A)->sin6_addr ) + ) || + ( (checklist->src_addr.ss_family == AF_INET) + && (((struct sockaddr_in *)A)->sin_addr.s_addr == 0) + ) + ) + ) { #if FOLLOW_X_FORWARDED_FOR if (Config.onoff.acl_uses_indirect_client) { checklist->src_addr = request->indirect_client_addr; @@ -2686,7 +2696,7 @@ static void aclIpDataToStr(const acl_ip_data * ip, char *buf, int len) { - snprintf(buf, len, "%s/%d", sockaddr_ntoa((struct sockaddr *)&ip->addr1), ip->masklen); + snprintf(buf, len, "%s/%d", sockaddr_ntoa(&ip->addr1), ip->masklen); } /* @@ -2752,7 +2762,7 @@ else if (masklen > 0) { invmasklen = 32 - masklen; debug(28, 3) ("aclIpNetworkCompare2: %s vs %s,\n", - sockaddr_ntoa((struct sockaddr *)&p->addr1), sockaddr_ntoa((struct sockaddr *)&q->addr1)); + sockaddr_ntoa(&p->addr1), sockaddr_ntoa(&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), @@ -2851,10 +2861,10 @@ MemBuf mb; wordlist **W = state; memBufDefInit(&mb); - memBufPrintf(&mb, "%s", sockaddr_ntoa((struct sockaddr *)&ip->addr1)); + memBufPrintf(&mb, "%s", sockaddr_ntoa(&ip->addr1)); /* if (ip->addr2.s_addr != any_addr.s_addr) - memBufPrintf(&mb, "-%s", sockaddr_ntoa((struct sockaddr *)&ip->addr2)); + memBufPrintf(&mb, "-%s", sockaddr_ntoa(&ip->addr2)); */ memBufPrintf(&mb, "/%d", ip->masklen); wordlistAdd(W, mb.buf); Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_cf.c,v retrieving revision 1.4.2.12 retrieving revision 1.4.2.13 diff -u -r1.4.2.12 -r1.4.2.13 --- squid/src/cache_cf.c 1 Jul 2007 05:44:18 -0000 1.4.2.12 +++ squid/src/cache_cf.c 1 Jul 2007 08:34:23 -0000 1.4.2.13 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.4.2.12 2007/07/01 05:44:18 amosjeffries Exp $ + * $Id: cache_cf.c,v 1.4.2.13 2007/07/01 08:34:23 amosjeffries Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -763,7 +763,6 @@ static void parse_address(struct sockaddr *addr) { - const struct hostent *hp; struct addrinfo hints, *res, *res0; int error; char *token = strtok(NULL, w_space); @@ -2896,7 +2895,7 @@ dump_generic_http_port(StoreEntry * e, const char *n, const http_port_list * s) { char host[100], port[8]; - getnameinfo(&s->s, SOCKLEN(&s->s), host, 100, port, 8, NI_NUMERICHOST|NI_NUMERICSERV); + getnameinfo((struct sockaddr *)&s->s, SOCKLEN(&s->s), host, 100, port, 8, NI_NUMERICHOST|NI_NUMERICSERV); storeAppendPrintf(e, "%s %s:%s", n, host, port); if (s->transparent) storeAppendPrintf(e, " transparent"); @@ -2906,7 +2905,8 @@ storeAppendPrintf(e, " defaultsite=%s", s->defaultsite); if (s->vhost) storeAppendPrintf(e, " vhost"); - if (s->vport == ntohs(s->s.sin_port)) + if ( (s->s.ss_family == AF_INET6 && s->vport == ntohs(((struct sockaddr_in6 *)&s->s)->sin6_port) ) || + (s->s.ss_family == AF_INET && s->vport == ntohs(((struct sockaddr_in *)&s->s)->sin_port) ) ) storeAppendPrintf(e, " vport"); else if (s->vport) storeAppendPrintf(e, " vport=%d", s->vport); Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.7.2.11 retrieving revision 1.7.2.12 diff -u -r1.7.2.11 -r1.7.2.12 --- squid/src/client_side.c 1 Jul 2007 05:44:20 -0000 1.7.2.11 +++ squid/src/client_side.c 1 Jul 2007 08:34:23 -0000 1.7.2.12 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.7.2.11 2007/07/01 05:44:20 amosjeffries Exp $ + * $Id: client_side.c,v 1.7.2.12 2007/07/01 08:34:23 amosjeffries Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1272,7 +1272,7 @@ http->al.icp.opcode = ICP_INVALID; http->al.url = http->uri; debug(33, 9) ("httpRequestFree: al.url='%s'\n", http->al.url); - http->al.cache.out_ip = request->out_ip; + xmemcpy(&http->al.cache.out_ip, &request->out_ip, sizeof(struct sockaddr_storage)); if (http->reply && http->log_type != LOG_TCP_DENIED) { http->al.http.code = http->reply->sline.status; http->al.http.content_type = strBuf(http->reply->content_type); @@ -1323,7 +1323,7 @@ http->al.reply = http->reply; accessLogLog(&http->al, http->acl_checklist); clientUpdateCounters(http); - clientdbUpdate(&conn->peer, http->log_type, PROTO_HTTP, http->out.size); + clientdbUpdate((struct sockaddr*)&conn->peer, http->log_type, PROTO_HTTP, http->out.size); } } if (http->acl_checklist) @@ -1378,7 +1378,7 @@ clientHttpRequest *http; debug(33, 3) ("connStateFree: FD %d\n", fd); assert(connState != NULL); - clientdbEstablished(&connState->peer, -1); /* decrement */ + clientdbEstablished((struct sockaddr*)&connState->peer, -1); /* decrement */ n = connState->reqs.head; while (n != NULL) { http = n->data; @@ -3867,7 +3867,7 @@ if (!DLINK_ISEMPTY(conn->reqs) && DLINK_HEAD(conn->reqs) == http) clientCheckFollowXForwardedFor(http); else { - debugs(33, 1, "WARNING: pipelined CONNECT request seen from " << sockaddr_ntoa(&http->conn->peer)); + debug(33, 1)("WARNING: pipelined CONNECT request seen from %s\n", sockaddr_ntoa(&http->conn->peer)); debugObj(33, 1, "Previous request:\n", ((clientHttpRequest *) DLINK_HEAD(conn->reqs))->request, (ObjPackMethod) & httpRequestPackDebug); debugObj(33, 1, "This request:\n", request, (ObjPackMethod) & httpRequestPackDebug); @@ -4194,8 +4194,7 @@ { clientHttpRequest *http = data; ConnStateData *conn = http->conn; - debug(33, 1) ("WARNING: Closing client %s connection due to lifetime timeout\n", - sockaddr_ntoa(&conn->peer)); + debug(33, 1) ("WARNING: Closing client %s connection due to lifetime timeout\n", sockaddr_ntoa(&conn->peer)); debug(33, 1) ("\t%s\n", http->uri); comm_close(fd); } @@ -4397,7 +4396,7 @@ while (max-- && !httpAcceptDefer(sock, NULL)) { memset(&peer, '\0', sizeof(struct sockaddr_storage)); memset(&me, '\0', sizeof(struct sockaddr_storage)); - if ((fd = comm_accept(sock, &peer, &me)) < 0) { + if ((fd = comm_accept(sock, (struct sockaddr*)&peer, (struct sockaddr*)&me)) < 0) { if (!ignoreErrno(errno)) debug(50, 1) ("httpAccept: FD %d: accept failure: %s\n", sock, xstrerror()); @@ -4751,11 +4750,10 @@ continue; } enter_suid(); - fd = comm_open(SOCK_STREAM, - IPPROTO_TCP, - &s->s, - COMM_NONBLOCKING, - "HTTP Socket"); + fd = comm_open(SOCK_STREAM, IPPROTO_TCP, + (struct sockaddr *)&s->s, + COMM_NONBLOCKING, + "HTTP Socket"); leave_suid(); if (fd < 0) continue; @@ -4766,7 +4764,7 @@ * peg the CPU with select() when we hit the FD limit. */ commSetDefer(fd, httpAcceptDefer, NULL); - getnameinfo(&s->s, SOCKLEN(&s->s), + getnameinfo((struct sockaddr*)&s->s, SOCKLEN(&s->s), host, 100, port, 8, NI_NUMERICHOST|NI_NUMERICSERV); debug(1, 1) ("Accepting %s HTTP connections at %s, port %s, FD %d.\n", s->transparent ? "transparently proxied" : Index: squid/src/comm.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm.c,v retrieving revision 1.4.6.10 retrieving revision 1.4.6.11 diff -u -r1.4.6.10 -r1.4.6.11 --- squid/src/comm.c 1 Jul 2007 05:44:20 -0000 1.4.6.10 +++ squid/src/comm.c 1 Jul 2007 08:34:27 -0000 1.4.6.11 @@ -1,6 +1,6 @@ /* - * $Id: comm.c,v 1.4.6.10 2007/07/01 05:44:20 amosjeffries Exp $ + * $Id: comm.c,v 1.4.6.11 2007/07/01 08:34:27 amosjeffries Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -228,34 +228,34 @@ } switch (addr->sa_family) { case AF_INET: - if (((struct sockaddr_in *)addr)->sin_addr.s_addr != no_addr.s_addr) { - if (commBind(new_socket, addr) != COMM_OK) { - comm_close(new_socket); - return -1; - } - } - F->local_port = ntohs(((struct sockaddr_in *)addr)->sin_port); + if (((struct sockaddr_in *)addr)->sin_addr.s_addr != no_addr.s_addr) { + if (commBind(new_socket, addr) != COMM_OK) { + comm_close(new_socket); + return -1; + } + } + F->local_port = ntohs(((struct sockaddr_in *)addr)->sin_port); break; case AF_INET6: { - struct in6_addr *s6 = &((struct sockaddr_in6 *)addr)->sin6_addr; - if (!IN6_IS_ADDR_ALLF( (struct in6_addr*)&((struct sockaddr_in6 *)addr)->sin6_addr )){ + struct in6_addr *s6 = &((struct sockaddr_in6 *)addr)->sin6_addr; + if (!IN6_IS_ADDR_ALLF( s6 ) ) { #ifdef IPV6_V6ONLY - const int on = 1; - if (setsockopt(new_socket, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) { - comm_close(new_socket); - return -1; - } -#endif - if (commBind(new_socket, addr) != COMM_OK) { - comm_close(new_socket); - return -1; - } + const int on = 1; + if (setsockopt(new_socket, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) { + comm_close(new_socket); + return -1; + } +#endif + if (commBind(new_socket, addr) != COMM_OK) { + comm_close(new_socket); + return -1; + } + } + F->local_port = ntohs(((struct sockaddr_in6 *)addr)->sin6_port); } - } - F->local_port = ntohs(((struct sockaddr_in6 *)addr)->sin6_port); break; - } + } xmemcpy(&F->local_addr, addr, SOCKLEN(addr)); if (flags & COMM_NONBLOCKING) @@ -291,7 +291,7 @@ } void -commConnectStart(int fd, const char *host, u_short port, CNCB * callback, void *data, struct in_addr *addr) +commConnectStart(int fd, const char *host, u_short port, CNCB * callback, void *data, struct sockaddr *addr) { ConnectStateData *cs; FwdState *fwdState = data; @@ -303,7 +303,7 @@ cs->callback = callback; cs->data = data; if (addr != NULL) { - cs->in_addr = *addr; + xmemcpy(&cs->in_addr, addr, sizeof(struct sockaddr_storage)); cs->addrcount = 1; } else { cs->addrcount = 0; @@ -557,7 +557,7 @@ x = connect(sock, address, SOCKLEN(address)); if (x < 0) debug(5, 2) ("connect FD %d to %s : %s\n", sock, - sockaddr_ntoa(address), xstrerror()); + sockaddr_ntoa((struct sockaddr *)address), xstrerror()); } else { #if defined(_SQUID_NEWSOS6_) /* Makoto MATSUSHITA */ @@ -595,7 +595,7 @@ return COMM_ERR_INV_ARGS; else return COMM_ERROR; - xstrncpy(F->ipaddr, sockaddr_ntoa(address), 80); + xstrncpy(F->ipaddr, sockaddr_ntoa((struct sockaddr *)address), 80); F->remote_port = (address->sa_family == AF_INET6) ? ntohs(((struct sockaddr_in6 *)address)->sin6_port) : ntohs(((struct sockaddr_in *)address)->sin_port); @@ -643,7 +643,7 @@ /* fdstat update */ fd_open(sock, FD_SOCKET, "HTTP Request"); F = &fd_table[sock]; - xstrncpy(F->ipaddr, sockaddr_ntoa(&P), 80); + xstrncpy(F->ipaddr, sockaddr_ntoa((struct sockaddr *)&P), 80); switch (P.ss_family) { case AF_INET6: F->remote_port = ntohs(((struct sockaddr_in6 *)&P)->sin6_port); Index: squid/src/forward.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/forward.c,v retrieving revision 1.4.6.8 retrieving revision 1.4.6.9 diff -u -r1.4.6.8 -r1.4.6.9 --- squid/src/forward.c 1 Jul 2007 05:44:22 -0000 1.4.6.8 +++ squid/src/forward.c 1 Jul 2007 08:34:28 -0000 1.4.6.9 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.4.6.8 2007/07/01 05:44:22 amosjeffries Exp $ + * $Id: forward.c,v 1.4.6.9 2007/07/01 08:34:28 amosjeffries Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -411,7 +411,7 @@ { acl_address *l; struct sockaddr_storage *addr; - sruct sockaddr_in *addr4; + struct sockaddr_in *addr4; aclChecklistCacheInit(ch); for (l = head; l; l = l->next) { if (aclMatchAclList(l->acl_list, ch)) Index: squid/src/icp_v2.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/icp_v2.c,v retrieving revision 1.3.6.6 retrieving revision 1.3.6.7 diff -u -r1.3.6.6 -r1.3.6.7 --- squid/src/icp_v2.c 1 Jul 2007 05:44:22 -0000 1.3.6.6 +++ squid/src/icp_v2.c 1 Jul 2007 08:34:28 -0000 1.3.6.7 @@ -1,6 +1,6 @@ /* - * $Id: icp_v2.c,v 1.3.6.6 2007/07/01 05:44:22 amosjeffries Exp $ + * $Id: icp_v2.c,v 1.3.6.7 2007/07/01 08:34:28 amosjeffries Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -380,7 +380,7 @@ debug(12, 4) ("icpHandleUdp: FD %d: received %d bytes from %s.\n", sock, len, - sockaddr_ntoa((struct sockaddr *)&from)); + sockaddr_ntoa(&from)); #ifdef ICP_PACKET_DUMP icpPktDump(buf); #endif @@ -396,7 +396,7 @@ else debug(12, 1) ("WARNING: Unused ICP version %d received from %s:%d\n", icp_version, - sockaddr_ntoa((struct sockaddr *)&from), + sockaddr_ntoa(&from), from.ss_family == AF_INET6 ? ntohs(((struct sockaddr_in6 *)&from)->sin6_port) : ntohs(((struct sockaddr_in *)&from)->sin_port) @@ -448,10 +448,10 @@ for (s = Config.mcast_group_list; s; s = s->next) ipcache_nbgethostbyname(s->key, mcastJoinGroups, NULL); debug(12, 1) ("Accepting ICP messages at %s, port %d, FD %d.\n", - sockaddr_ntoa((struct sockaddr *)&Config.Addrs.udp_incoming), + sockaddr_ntoa(&Config.Addrs.udp_incoming), (int) port, theInIcpConnection); debug(12, 1) ("Accepting ICP messages v6 at %s, port %d, FD %d.\n", - sockaddr_ntoa((struct sockaddr *)&Config.Addrs.udp6_incoming), + sockaddr_ntoa(&Config.Addrs.udp6_incoming), (int) port, theInIcpConnection6); if (((struct sockaddr_in *)&Config.Addrs.udp_outgoing)->sin_addr.s_addr != no_addr.s_addr) { Index: squid/src/ipcache.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ipcache.c,v retrieving revision 1.4.6.13 retrieving revision 1.4.6.14 diff -u -r1.4.6.13 -r1.4.6.14 --- squid/src/ipcache.c 1 Jul 2007 05:44:23 -0000 1.4.6.13 +++ squid/src/ipcache.c 1 Jul 2007 08:34:28 -0000 1.4.6.14 @@ -1,6 +1,6 @@ /* - * $Id: ipcache.c,v 1.4.6.13 2007/07/01 05:44:23 amosjeffries Exp $ + * $Id: ipcache.c,v 1.4.6.14 2007/07/01 08:34:28 amosjeffries Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -385,7 +385,7 @@ xmemcpy(&this_answer->sin_addr, answers[k].rdata, 4); debug(14, 3) ("ipcacheParse: #%d %s\n", j, - sockaddr_ntoa((struct sockaddr *)&i->addrs.in_addrs[j+i->addrs.count])); + sockaddr_ntoa(&i->addrs.in_addrs[j+i->addrs.count])); j++; } else if (answers[k].type == RFC1035_TYPE_AAAA) { struct sockaddr_in6 *this_answer = (struct sockaddr_in6 *)&i->addrs.in_addrs[j+i->addrs.count]; @@ -398,7 +398,7 @@ xmemcpy(&this_answer->sin6_addr, answers[k].rdata, 16); debug(14, 3) ("ipcacheParse: #%d %s\n", j, - sockaddr_ntoa((struct sockaddr *)&i->addrs.in_addrs[j+i->addrs.count])); + sockaddr_ntoa(&i->addrs.in_addrs[j+i->addrs.count])); j++; i->addrs.cur = i->addrs.count; if (i->addrs.cur) Index: squid/src/neighbors.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/neighbors.c,v retrieving revision 1.5.4.9 retrieving revision 1.5.4.10 diff -u -r1.5.4.9 -r1.5.4.10 --- squid/src/neighbors.c 1 Jul 2007 05:44:24 -0000 1.5.4.9 +++ squid/src/neighbors.c 1 Jul 2007 08:34:29 -0000 1.5.4.10 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.c,v 1.5.4.9 2007/07/01 05:44:24 amosjeffries Exp $ + * $Id: neighbors.c,v 1.5.4.10 2007/07/01 08:34:29 amosjeffries Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -1192,7 +1192,7 @@ LOCAL_ARRAY(char, url, MAX_URL); assert(p->type == PEER_MULTICAST); p->mcast.flags.count_event_pending = 0; - snprintf(url, MAX_URL, "http://%s/", sockaddr_ntoa(p->in_addr.sin_addr)); + snprintf(url, MAX_URL, "http://%s/", sockaddr_ntoa(&p->in_addr)); fake = storeCreateEntry(url, null_request_flags, METHOD_GET); psstate = cbdataAlloc(ps_state); psstate->request = requestLink(urlParse(METHOD_GET, url)); Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.5.2.13 retrieving revision 1.5.2.14 diff -u -r1.5.2.13 -r1.5.2.14 --- squid/src/protos.h 1 Jul 2007 05:44:24 -0000 1.5.2.13 +++ squid/src/protos.h 1 Jul 2007 08:34:29 -0000 1.5.2.14 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.5.2.13 2007/07/01 05:44:24 amosjeffries Exp $ + * $Id: protos.h,v 1.5.2.14 2007/07/01 08:34:29 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -157,12 +157,12 @@ #if LINGERING_CLOSE extern void comm_lingering_close(int fd); #endif -extern void commConnectStart(int fd, const char *, u_short, CNCB *, void *, struct in_addr *addr); +extern void commConnectStart(int fd, const char *, u_short, CNCB *, void *, struct sockaddr *addr); extern int comm_connect_addr(int sock, const struct sockaddr *); extern void comm_init(void); extern int comm_listen(int sock); -extern int comm_open(int, int, struct sockaddr *, u_short port, int, const char *note); -extern int comm_openex(int, int, struct sockaddr *, u_short, int, unsigned char TOS, const char *); +extern int comm_open(int, int, struct sockaddr *, int, const char *note); +extern int comm_openex(int, int, struct sockaddr *, int, unsigned char TOS, const char *); extern u_short comm_local_port(int fd); extern void commDeferFD(int fd); @@ -1208,7 +1208,7 @@ int xusleep(unsigned int usec); void keepCapabilities(void); -extern char *sockaddr_ntoa(struct sockaddr *); +extern char *sockaddr_ntoa(struct sockaddr_storage *); #if USE_HTCP extern void htcpInit(void); Index: squid/src/ssl.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ssl.c,v retrieving revision 1.3.6.8 retrieving revision 1.3.6.9 diff -u -r1.3.6.8 -r1.3.6.9 --- squid/src/ssl.c 1 Jul 2007 05:44:24 -0000 1.3.6.8 +++ squid/src/ssl.c 1 Jul 2007 08:34:29 -0000 1.3.6.9 @@ -1,6 +1,6 @@ /* - * $Id: ssl.c,v 1.3.6.8 2007/07/01 05:44:24 amosjeffries Exp $ + * $Id: ssl.c,v 1.3.6.9 2007/07/01 08:34:29 amosjeffries Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -65,6 +65,7 @@ static PF sslReadClient; static PF sslReadServer; static PF sslTimeout; +static void sslConnectTimeout(int fd, void *data); static PF sslWriteClient; static PF sslWriteServer; static PSC sslPeerSelectComplete; @@ -444,7 +445,7 @@ newsockaddr.ss_family = AF_INET6; newsock = comm_openex(SOCK_STREAM, IPPROTO_TCP, - &newsockaddr, + (struct sockaddr*)&newsockaddr, COMM_NONBLOCKING, 0, sslState->url); @@ -473,7 +474,8 @@ commConnectStart(sslState->server.fd, sslState->host, sslState->port, sslConnectDone, - sslState); + sslState, + &newsockaddr); } else if (status != COMM_OK) { comm_close(fd); err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE, request); @@ -534,7 +536,7 @@ int fd = http->conn->fd; request_t *request = http->request; char *url = http->uri; - struct in_addr outgoing; + struct sockaddr_storage outgoing; unsigned long tos; struct sockaddr_storage addr; /* @@ -564,12 +566,10 @@ /* Create socket. */ memset(&addr, '\0', sizeof(addr)); addr.ss_family = AF_INET; - sock = comm_openex(SOCK_STREAM, + sock = comm_open(SOCK_STREAM, IPPROTO_TCP, &addr, - 0, COMM_NONBLOCKING, - 0, url); if (sock == COMM_ERROR) { debug(26, 4) ("sslStart: Failed because we're out of sockets.\n"); @@ -595,7 +595,7 @@ sslState->client.buf = xmalloc(SQUID_TCP_SO_RCVBUF); /* Copy any pending data from the client connection */ sslState->client.len = http->conn->in.offset; - sslState->request->out_ip = outgoing; +// AYJ: 'outgoing' in uninitialised local variable. sslState->request->out_ip = outgoing; sslState->ia_cur = -1; if (sslState->client.len > 0) { if (sslState->client.len > SQUID_TCP_SO_RCVBUF) { Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.7.2.11 retrieving revision 1.7.2.12 diff -u -r1.7.2.11 -r1.7.2.12 --- squid/src/structs.h 1 Jul 2007 05:44:24 -0000 1.7.2.11 +++ squid/src/structs.h 1 Jul 2007 08:34:29 -0000 1.7.2.12 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.7.2.11 2007/07/01 05:44:24 amosjeffries Exp $ + * $Id: structs.h,v 1.7.2.12 2007/07/01 08:34:29 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1913,7 +1913,7 @@ char *peer_domain; /* Configured peer forceddomain */ BODY_HANDLER *body_reader; void *body_reader_data; - struct in_addr out_ip; + struct sockaddr_storage out_ip; String extacl_log; /* String to be used for access.log purposes */ const char *extacl_user; /* User name returned by extacl lookup */ const char *extacl_passwd; /* Password returned by extacl lookup */ Index: squid/src/tools.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/tools.c,v retrieving revision 1.4.2.11 retrieving revision 1.4.2.12 diff -u -r1.4.2.11 -r1.4.2.12 --- squid/src/tools.c 1 Jul 2007 05:44:25 -0000 1.4.2.11 +++ squid/src/tools.c 1 Jul 2007 08:34:30 -0000 1.4.2.12 @@ -1,6 +1,6 @@ /* - * $Id: tools.c,v 1.4.2.11 2007/07/01 05:44:25 amosjeffries Exp $ + * $Id: tools.c,v 1.4.2.12 2007/07/01 08:34:30 amosjeffries Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -1364,11 +1364,11 @@ } char * -sockaddr_ntoa(struct sockaddr *addr) +sockaddr_ntoa(struct sockaddr_storage *addr) { static char host[100]; memset(host, '\0', 100); - getnameinfo(addr, SOCKLEN(addr), host, 100, NULL, 0, NI_NUMERICHOST); + getnameinfo((struct sockaddr *)addr, SOCKLEN(addr), host, 100, NULL, 0, NI_NUMERICHOST); return host; } Index: squid/src/url.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/url.c,v retrieving revision 1.3.6.6 retrieving revision 1.3.6.7 diff -u -r1.3.6.6 -r1.3.6.7 --- squid/src/url.c 1 Jul 2007 05:44:26 -0000 1.3.6.6 +++ squid/src/url.c 1 Jul 2007 08:34:30 -0000 1.3.6.7 @@ -1,6 +1,6 @@ /* - * $Id: url.c,v 1.3.6.6 2007/07/01 05:44:26 amosjeffries Exp $ + * $Id: url.c,v 1.3.6.7 2007/07/01 08:34:30 amosjeffries Exp $ * * DEBUG: section 23 URL Parsing * AUTHOR: Duane Wessels @@ -446,6 +446,7 @@ const char * urlCanonical(request_t * request) { + LOCAL_ARRAY(char, hostbuf, MAX_URL); LOCAL_ARRAY(char, portbuf, 32); LOCAL_ARRAY(char, urlbuf, MAX_URL); if (request->canonical)