--------------------- PatchSet 4551 Date: 2007/05/15 13:42:40 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Rollout IPv6 into ident. Members: src/ACLIdent.cc:1.10.4.3->1.10.4.4 src/client_side.cc:1.68.2.21->1.68.2.22 src/ident.cc:1.11.8.6->1.11.8.7 src/protos.h:1.48.4.17->1.48.4.18 Index: squid3/src/ACLIdent.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLIdent.cc,v retrieving revision 1.10.4.3 retrieving revision 1.10.4.4 diff -u -r1.10.4.3 -r1.10.4.4 --- squid3/src/ACLIdent.cc 29 Apr 2007 03:01:35 -0000 1.10.4.3 +++ squid3/src/ACLIdent.cc 15 May 2007 13:42:40 -0000 1.10.4.4 @@ -1,5 +1,5 @@ /* - * $Id: ACLIdent.cc,v 1.10.4.3 2007/04/29 03:01:35 amosjeffries Exp $ + * $Id: ACLIdent.cc,v 1.10.4.4 2007/05/15 13:42:40 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -128,7 +128,9 @@ if (checklist->conn() != NULL) { debugs(28, 3, "IdentLookup::checkForAsync: Doing ident lookup" ); checklist->asyncInProgress(true); - identStart(&checklist->conn()->me, &checklist->conn()->peer, +/* FIXME INET6 : drop temp conversion */ IPAddress tmpme(checklist->conn()->me); +/* FIXME INET6 : drop temp conversion */ IPAddress tmppeer(checklist->conn()->peer); + identStart(tmpme, tmppeer, LookupDone, checklist); } else { debugs(28, 1, "IdentLookup::checkForAsync: Can't start ident lookup. No client connection" ); Index: squid3/src/client_side.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side.cc,v retrieving revision 1.68.2.21 retrieving revision 1.68.2.22 diff -u -r1.68.2.21 -r1.68.2.22 --- squid3/src/client_side.cc 11 May 2007 16:05:41 -0000 1.68.2.21 +++ squid3/src/client_side.cc 15 May 2007 13:42:41 -0000 1.68.2.22 @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.68.2.21 2007/05/11 16:05:41 amosjeffries Exp $ + * $Id: client_side.cc,v 1.68.2.22 2007/05/15 13:42:41 amosjeffries Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2756,7 +2756,11 @@ /* cbdataReferenceDone() happens in either fastCheck() or ~ACLCheckList */ if (identChecklist.fastCheck()) - identStart(&details->me, &details->peer, clientIdentDone, connState); +{ +/* FIXME INET6 : drop temp conversion */ IPAddress tmpme(details->me); +/* FIXME INET6 : drop temp conversion */ IPAddress tmppeer(details->peer); + identStart(tmpme, tmppeer, clientIdentDone, connState); +} #endif Index: squid3/src/ident.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ident.cc,v retrieving revision 1.11.8.6 retrieving revision 1.11.8.7 diff -u -r1.11.8.6 -r1.11.8.7 --- squid3/src/ident.cc 29 Apr 2007 14:18:24 -0000 1.11.8.6 +++ squid3/src/ident.cc 15 May 2007 13:42:42 -0000 1.11.8.7 @@ -1,6 +1,6 @@ /* - * $Id: ident.cc,v 1.11.8.6 2007/04/29 14:18:24 amosjeffries Exp $ + * $Id: ident.cc,v 1.11.8.7 2007/05/15 13:42:42 amosjeffries Exp $ * * DEBUG: section 30 Ident (RFC 931) * AUTHOR: Duane Wessels @@ -55,9 +55,9 @@ hash_link hash; /* must be first */ int fd; /* IDENT fd */ - struct sockaddr_in me; + IPAddress me; - struct sockaddr_in my_peer; + IPAddress my_peer; IdentClient *clients; char buf[4096]; } @@ -107,7 +107,7 @@ identTimeout(int fd, void *data) { IdentStateData *state = (IdentStateData *)data; - debugs(30, 3, "identTimeout: FD " << fd << ", " << inet_ntoa(state->my_peer.sin_addr)); + debugs(30, 3, "identTimeout: FD " << fd << ", " << state->my_peer); comm_close(fd); } @@ -141,8 +141,8 @@ MemBuf mb; mb.init(); mb.Printf("%d, %d\r\n", - ntohs(state->my_peer.sin_port), - ntohs(state->me.sin_port)); + state->my_peer.GetPort(), + state->me.GetPort()); comm_write_mbuf(fd, &mb, NULL, state); comm_read(fd, state->buf, BUFSIZ, identReadReply, state); commSetTimeout(fd, Config.Timeout.ident, identTimeout, state); @@ -212,28 +212,17 @@ * start a TCP connection to the peer host on port 113 */ void - -identStart(struct sockaddr_in *me, struct sockaddr_in *my_peer, IDCB * callback, void *data) +identStart(IPAddress &me, IPAddress &my_peer, IDCB * callback, void *data) { IdentStateData *state; int fd; char key1[IDENT_KEY_SZ]; char key2[IDENT_KEY_SZ]; char key[IDENT_KEY_SZ]; -#ifdef INET6 - snprintf(key1, IDENT_KEY_SZ, "[%s]:%d", -#else - snprintf(key1, IDENT_KEY_SZ, "%s:%d", -#endif - inet_ntoa(me->sin_addr), - ntohs(me->sin_port)); -#ifdef INET6 - snprintf(key2, IDENT_KEY_SZ, "[%s]:%d", -#else - snprintf(key2, IDENT_KEY_SZ, "%s:%d", -#endif - inet_ntoa(my_peer->sin_addr), - ntohs(my_peer->sin_port)); + char ntoabuf[MAX_IPSTRLEN]; + + me.ToURL(key1, IDENT_KEY_SZ); + my_peer.ToURL(key2, IDENT_KEY_SZ); snprintf(key, IDENT_KEY_SZ, "%s,%s", key1, key2); if ((state = (IdentStateData *)hash_lookup(ident_hash, key)) != NULL) @@ -242,10 +231,9 @@ return; } -/* FIXME INET6 : drop temp conversion boundary */ IPAddress tmp(*me); fd = comm_open(SOCK_STREAM, IPPROTO_TCP, - tmp, + me, COMM_NONBLOCKING, "ident"); @@ -260,8 +248,8 @@ state = cbdataAlloc(IdentStateData); state->hash.key = xstrdup(key); state->fd = fd; - state->me = *me; - state->my_peer = *my_peer; + state->me = me; + state->my_peer = my_peer; identClientAdd(state, callback, data); hash_join(ident_hash, &state->hash); comm_add_close_handler(fd, @@ -269,7 +257,7 @@ state); commSetTimeout(fd, Config.Timeout.ident, identTimeout, state); commConnectStart(fd, - inet_ntoa(state->my_peer.sin_addr), + state->my_peer.NtoA(ntoabuf,MAX_IPSTRLEN), IDENT_PORT, identConnectDone, state); Index: squid3/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/protos.h,v retrieving revision 1.48.4.17 retrieving revision 1.48.4.18 diff -u -r1.48.4.17 -r1.48.4.18 --- squid3/src/protos.h 5 May 2007 14:44:07 -0000 1.48.4.17 +++ squid3/src/protos.h 15 May 2007 13:42:42 -0000 1.48.4.18 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.48.4.17 2007/05/05 14:44:07 amosjeffries Exp $ + * $Id: protos.h,v 1.48.4.18 2007/05/15 13:42:42 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -455,7 +455,7 @@ /* ident.c */ #if USE_IDENT -SQUIDCEXTERN void identStart(struct sockaddr_in *me, struct sockaddr_in *my_peer, +SQUIDCEXTERN void identStart(IPAddress &me, IPAddress &my_peer, IDCB * callback, void *cbdata); SQUIDCEXTERN void identInit(void); #endif