--------------------- PatchSet 4129 Date: 2007/03/28 09:42:04 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Fix (for now) Connecting to wrong port on remote server Members: NOTES-IPv6:1.1.2.6->1.1.2.7 src/ACLChecklist.cc:1.22.4.7->1.22.4.8 src/comm.cc:1.47.2.11->1.47.2.12 Index: squid3/NOTES-IPv6 =================================================================== RCS file: /cvsroot/squid-sf//squid3/Attic/NOTES-IPv6,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- squid3/NOTES-IPv6 25 Mar 2007 13:18:51 -0000 1.1.2.6 +++ squid3/NOTES-IPv6 28 Mar 2007 09:42:04 -0000 1.1.2.7 @@ -1,19 +1,13 @@ -$Id: NOTES-IPv6,v 1.1.2.6 2007/03/25 13:18:51 amosjeffries Exp $ +$Id: NOTES-IPv6,v 1.1.2.7 2007/03/28 09:42:04 amosjeffries Exp $ KNOWN BUGS: -1) -'(110) Connecton Timeout' on request. -CAUSE: Malformed DNS Packet sent by squid. Located using wireshark which shows a single-byte of DNS packet. - Code location for this bug is still unknown. - - -2) -ApplyMask - - produces a strange IPA through NtoA in debug trace. - - appears to be strange input from hostent +PROBLEM: Attempts to connect to Port 20480 instead of 80 +CAUSE: error with ntohs() or htons() in the wrong place or vice versa. + _all_ locally stored port values should be HS in converted code. + unfortunatey this may reccur at any time until conversion is complete. TODO: Index: squid3/src/ACLChecklist.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACLChecklist.cc,v retrieving revision 1.22.4.7 retrieving revision 1.22.4.8 diff -u -r1.22.4.7 -r1.22.4.8 --- squid3/src/ACLChecklist.cc 21 Mar 2007 08:55:09 -0000 1.22.4.7 +++ squid3/src/ACLChecklist.cc 28 Mar 2007 09:42:06 -0000 1.22.4.8 @@ -1,5 +1,5 @@ /* - * $Id: ACLChecklist.cc,v 1.22.4.7 2007/03/21 08:55:09 amosjeffries Exp $ + * $Id: ACLChecklist.cc,v 1.22.4.8 2007/03/28 09:42:06 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -524,7 +524,7 @@ checklist->request = HTTPMSGLOCK(request); checklist->src_addr = request->client_addr; checklist->my_addr = request->my_addr; - checklist->my_addr.SetPort(request->my_port); + checklist->my_addr.SetPort(request->my_port); /* request->my_port is confirmed as HS natively */ } #if USE_IDENT Index: squid3/src/comm.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/comm.cc,v retrieving revision 1.47.2.11 retrieving revision 1.47.2.12 diff -u -r1.47.2.11 -r1.47.2.12 --- squid3/src/comm.cc 18 Mar 2007 02:41:00 -0000 1.47.2.11 +++ squid3/src/comm.cc 28 Mar 2007 09:42:06 -0000 1.47.2.12 @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.47.2.11 2007/03/18 02:41:00 amosjeffries Exp $ + * $Id: comm.cc,v 1.47.2.12 2007/03/28 09:42:06 amosjeffries Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -1161,7 +1161,7 @@ ConnectStateData::defaults() { S = in_addr; - S.SetPort(htons(port)); + S.SetPort(port); } void @@ -1224,20 +1224,20 @@ } int - comm_connect_addr(int sock, IPAddress &address) { -#if INET6 +#if USE_IPV6 struct sockaddr_in6 saddr; #else struct sockaddr_in saddr; #endif - address.GetSockAddr(saddr); comm_err_t status = COMM_OK; fde *F = &fd_table[sock]; int x; int err = 0; socklen_t errlen; + + address.GetSockAddr(saddr); assert(address.GetPort() != 0); PROF_start(comm_connect_addr); /* Establish connection. */ @@ -1302,7 +1302,7 @@ /* FIXME : magic 16 will cause problems in IPv6. Try MAX_IPSTRLEN instead. */ address.NtoA(F->ipaddr, 16); - F->remote_port = ntohs(address.GetPort()); + F->remote_port = address.GetPort(); /* _assuming_ remote_port is HS due to debug below */ if (status == COMM_OK) {