--------------------- PatchSet 3286 Date: 2001/10/30 09:01:21 Author: rvenning Branch: ipv6 Tag: (none) Log: fixed 'blind' patch Members: src/acl.c:1.4.6.10->1.4.6.11 src/authenticate.c:1.4.6.6->1.4.6.7 src/cache_cf.c:1.4.2.7->1.4.2.8 src/comm.c:1.4.6.6->1.4.6.7 src/dns_internal.c:1.5.6.5->1.5.6.6 src/forward.c:1.4.6.4->1.4.6.5 src/protos.h:1.5.2.8->1.5.2.9 src/structs.h:1.7.2.6->1.7.2.7 Index: squid/src/acl.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/acl.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/acl.c 25 Oct 2001 18:24:53 -0000 1.4.6.10 +++ squid/src/acl.c 30 Oct 2001 09:01:21 -0000 1.4.6.11 @@ -1,6 +1,6 @@ /* - * $Id: acl.c,v 1.4.6.10 2001/10/25 18:24:53 hno Exp $ + * $Id: acl.c,v 1.4.6.11 2001/10/30 09:01:21 rvenning Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -68,7 +68,7 @@ static void aclParseUserMaxIP(void *data); static void aclDestroyUserMaxIP(void *data); static wordlist *aclDumpUserMaxIP(void *data); -static int aclMatchUserMaxIP(void *, auth_user_request_t *, struct in_addr); +static int aclMatchUserMaxIP(void *, auth_user_request_t *, struct IN_ADDR); static squid_acl aclStrToType(const char *s); static int decode_addr(const char *, struct IN_ADDR *, struct IN_ADDR *); static void aclCheck(aclCheck_t * checklist); @@ -1306,7 +1306,7 @@ */ int aclMatchUserMaxIP(void *data, auth_user_request_t * auth_user_request, - struct in_addr src_addr) + struct IN_ADDR src_addr) { /* * > the logic for flush the ip list when the limit is hit vs keep it sorted in most recent access order and just drop the oldest one off is currently undecided Index: squid/src/authenticate.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/authenticate.c,v retrieving revision 1.4.6.6 retrieving revision 1.4.6.7 diff -u -r1.4.6.6 -r1.4.6.7 --- squid/src/authenticate.c 25 Oct 2001 18:24:54 -0000 1.4.6.6 +++ squid/src/authenticate.c 30 Oct 2001 09:01:23 -0000 1.4.6.7 @@ -1,6 +1,6 @@ /* - * $Id: authenticate.c,v 1.4.6.6 2001/10/25 18:24:54 hno Exp $ + * $Id: authenticate.c,v 1.4.6.7 2001/10/30 09:01:23 rvenning Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -265,7 +265,7 @@ while (ipdata) { tempnode = (auth_user_ip_t *) ipdata->node.next; /* walk the ip list */ - if (memcmp(&ipdata->ipaddr, &ipaddr) == 0) { + if (memcmp(&ipdata->ipaddr, &ipaddr, sizeof(ipaddr)) == 0) { /* This ip has alreadu been seen. */ found = 1; /* update IP ttl */ @@ -291,7 +291,7 @@ dlinkAddTail(ipdata, &ipdata->node, &auth_user->ip_list); auth_user->ipcount++; - ip1 = xstrdup(inet_ntoa(ipaddr)); + ip1 = xstrdup(INET_NTOA(ipaddr)); debug(29, 1) ("authenticateAuthUserRequestSetIp: user '%s' has been seen at a new IP address (%s)\n ", authenticateUserUsername(auth_user), ip1); safe_free(ip1); } @@ -307,7 +307,7 @@ ipdata = (auth_user_ip_t *) auth_user->ip_list.head; while (ipdata) { /* walk the ip list */ - if (memcmp(&ipdata->ipaddr, &ipaddr) == 0) { + if (memcmp(&ipdata->ipaddr, &ipaddr, sizeof(ipaddr)) == 0) { /* remove the node */ dlinkDelete(&ipdata->node, &auth_user->ip_list); cbdataFree(ipdata); @@ -422,7 +422,7 @@ * the authenticateStart routine for rv==AUTH_ACL_HELPER */ auth_acl_t -authenticateAuthenticate(auth_user_request_t ** auth_user_request, http_hdr_type headertype, request_t * request, ConnStateData * conn, struct in_addr src_addr) +authenticateAuthenticate(auth_user_request_t ** auth_user_request, http_hdr_type headertype, request_t * request, ConnStateData * conn, struct IN_ADDR src_addr) { const char *proxy_auth; assert(headertype != 0); Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_cf.c,v retrieving revision 1.4.2.7 retrieving revision 1.4.2.8 diff -u -r1.4.2.7 -r1.4.2.8 --- squid/src/cache_cf.c 25 Oct 2001 18:24:54 -0000 1.4.2.7 +++ squid/src/cache_cf.c 30 Oct 2001 09:01:26 -0000 1.4.2.8 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.4.2.7 2001/10/25 18:24:54 hno Exp $ + * $Id: cache_cf.c,v 1.4.2.8 2001/10/30 09:01:26 rvenning Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -632,8 +632,8 @@ { acl_address *l; for (l = head; l; l = l->next) { - if (l->addr.s_addr != INADDR_ANY) - storeAppendPrintf(entry, "%s %s", name, inet_ntoa(l->addr)); + if (!ADDR_IS_ANYADDR(l->addr)) + storeAppendPrintf(entry, "%s %s", name, INET_NTOA(l->addr)); else storeAppendPrintf(entry, "%s autoselect", name); dump_acl_list(entry, l->acl_list); Index: squid/src/comm.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm.c,v retrieving revision 1.4.6.6 retrieving revision 1.4.6.7 diff -u -r1.4.6.6 -r1.4.6.7 --- squid/src/comm.c 25 Oct 2001 18:24:54 -0000 1.4.6.6 +++ squid/src/comm.c 30 Oct 2001 09:01:27 -0000 1.4.6.7 @@ -1,6 +1,6 @@ /* - * $Id: comm.c,v 1.4.6.6 2001/10/25 18:24:54 hno Exp $ + * $Id: comm.c,v 1.4.6.7 2001/10/30 09:01:27 rvenning Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -355,7 +355,7 @@ * yuck, this has assumptions about comm_open() arguments for * the original socket */ - if (commBind(cs->fd, F->local_addr, F->local_port) != COMM_OK) { + if (commBind(cs->fd, &F->local_addr, F->local_port) != COMM_OK) { debug(5, 0) ("commResetFD: bind: %s\n", xstrerror()); return 0; } Index: squid/src/dns_internal.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/dns_internal.c,v retrieving revision 1.5.6.5 retrieving revision 1.5.6.6 diff -u -r1.5.6.5 -r1.5.6.6 --- squid/src/dns_internal.c 25 Oct 2001 18:24:54 -0000 1.5.6.5 +++ squid/src/dns_internal.c 30 Oct 2001 09:01:27 -0000 1.5.6.6 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.c,v 1.5.6.5 2001/10/25 18:24:54 hno Exp $ + * $Id: dns_internal.c,v 1.5.6.6 2001/10/30 09:01:27 rvenning Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -613,8 +613,8 @@ static int init = 0; if (DnsSocket < 0) { int port; - struct in_addr addr; - if (Config.Addrs.udp_outgoing.s_addr != no_addr.s_addr) + struct IN_ADDR addr; + if (!ADDR_IS_NOADDR(Config.Addrs.udp_outgoing)) addr = Config.Addrs.udp_outgoing; else addr = Config.Addrs.udp_incoming; @@ -631,7 +631,7 @@ */ port = comm_local_port(DnsSocket); debug(78, 1) ("DNS Socket created at %s, port %d, FD %d\n", - inet_ntoa(addr), + INET_NTOA(addr), port, DnsSocket); } assert(0 == nns); Index: squid/src/forward.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/forward.c,v retrieving revision 1.4.6.4 retrieving revision 1.4.6.5 diff -u -r1.4.6.4 -r1.4.6.5 --- squid/src/forward.c 25 Oct 2001 18:24:54 -0000 1.4.6.4 +++ squid/src/forward.c 30 Oct 2001 09:01:27 -0000 1.4.6.5 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.4.6.4 2001/10/25 18:24:54 hno Exp $ + * $Id: forward.c,v 1.4.6.5 2001/10/30 09:01:27 rvenning Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -266,16 +266,16 @@ comm_close(fd); } -static struct in_addr +static struct IN_ADDR aclMapAddr(acl_address * head, aclCheck_t * ch) { acl_address *l; - struct in_addr addr; + struct IN_ADDR addr; for (l = head; l; l = l->next) { if (aclMatchAclList(l->acl_list, ch)) return l->addr; } - addr.s_addr = INADDR_ANY; + addr = INADDR_ANY_ASSIGN; return addr; } @@ -290,7 +290,7 @@ return 0; } -struct in_addr +struct IN_ADDR getOutgoingAddr(request_t * request) { aclCheck_t ch; @@ -329,7 +329,7 @@ const char *host; unsigned short port; time_t ctimeout; - struct in_addr outgoing; + struct IN_ADDR outgoing; unsigned short tos; assert(fs); assert(fwdState->server_fd == -1); @@ -364,7 +364,7 @@ tos = getOutgoingTOS(fwdState->request); debug(17, 3) ("fwdConnectStart: got addr %s, tos %d\n", - inet_ntoa(outgoing), tos); + INET_NTOA(outgoing), tos); fd = comm_openex(SOCK_STREAM, 0, outgoing, Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,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/protos.h 25 Oct 2001 18:24:55 -0000 1.5.2.8 +++ squid/src/protos.h 30 Oct 2001 09:01:27 -0000 1.5.2.9 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.5.2.8 2001/10/25 18:24:55 hno Exp $ + * $Id: protos.h,v 1.5.2.9 2001/10/30 09:01:27 rvenning Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -725,7 +725,7 @@ extern void fwdLogRotate(void); extern void fwdStatus(FwdState *, http_status); #endif -struct in_addr getOutgoingAddr(request_t * request); +struct IN_ADDR getOutgoingAddr(request_t * request); unsigned long getOutgoingTOS(request_t * request); extern void urnStart(request_t *, StoreEntry *); @@ -747,7 +747,7 @@ extern void authenticateShutdown(void); extern void authenticateFixHeader(HttpReply *, auth_user_request_t *, request_t *, int, int); extern void authenticateAddTrailer(HttpReply *, auth_user_request_t *, request_t *, int); -extern auth_acl_t authenticateAuthenticate(auth_user_request_t **, http_hdr_type, request_t *, ConnStateData *, struct in_addr); +extern auth_acl_t authenticateAuthenticate(auth_user_request_t **, http_hdr_type, request_t *, ConnStateData *, struct IN_ADDR); extern void authenticateAuthUserUnlock(auth_user_t * auth_user); extern void authenticateAuthUserLock(auth_user_t * auth_user); extern void authenticateAuthUserRequestUnlock(auth_user_request_t *); Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.7.2.6 retrieving revision 1.7.2.7 diff -u -r1.7.2.6 -r1.7.2.7 --- squid/src/structs.h 25 Oct 2001 18:24:55 -0000 1.7.2.6 +++ squid/src/structs.h 30 Oct 2001 09:01:28 -0000 1.7.2.7 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.7.2.6 2001/10/25 18:24:55 hno Exp $ + * $Id: structs.h,v 1.7.2.7 2001/10/30 09:01:28 rvenning Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -263,7 +263,7 @@ struct _acl_address { acl_address *next; acl_list *acl_list; - struct in_addr addr; + struct IN_ADDR addr; }; struct _acl_tos { @@ -747,7 +747,7 @@ unsigned int type; u_short local_port; u_short remote_port; - struct in_addr local_addr; + struct IN_ADDR local_addr; unsigned char tos; char ipaddr[MAXIPSTRLEN]; char desc[FD_DESC_SZ];