--------------------- PatchSet 4424 Date: 2007/04/30 14:38:24 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Fix compile errors in IPv4 build. Remove defunct and broken INET6 blocks in Pasv processing. Members: src/ftp.cc:1.26.2.17->1.26.2.18 Index: squid3/src/ftp.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ftp.cc,v retrieving revision 1.26.2.17 retrieving revision 1.26.2.18 diff -u -r1.26.2.17 -r1.26.2.18 --- squid3/src/ftp.cc 30 Apr 2007 14:24:48 -0000 1.26.2.17 +++ squid3/src/ftp.cc 30 Apr 2007 14:38:24 -0000 1.26.2.18 @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.26.2.17 2007/04/30 14:24:48 amosjeffries Exp $ + * $Id: ftp.cc,v 1.26.2.18 2007/04/30 14:38:24 amosjeffries Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -2348,9 +2348,6 @@ { int code = ftpState->ctrl.replycode; int h1, h2, h3, h4; -#if USE_IPV6 - int h5, h6, h7, h8, h9, h10, h11, h12, h13, h14, h15, h16; -#endif int p1, p2; int n; u_short port; @@ -2371,19 +2368,9 @@ buf = ftpState->ctrl.last_reply + strcspn(ftpState->ctrl.last_reply, "0123456789"); -#if USE_IPV6 - n = sscanf(buf, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", - &h1, &h2, &h3, &h4, - &h5, &h6, &h7, &h8, - &h9, &h10, &h11, &h12, - &h13, &h14, &h15, &h16, - &p1, &p2); - if (n != 18 || p1 < 0 || p2 < 0 || p1 > 255 || p2 > 255) { -#else n = sscanf(buf, "%d,%d,%d,%d,%d,%d", &h1, &h2, &h3, &h4, &p1, &p2); if (n != 6 || p1 < 0 || p2 < 0 || p1 > 255 || p2 > 255) { -#endif debugs(9, 1, "Unsafe PASV reply from " << fd_table[ftpState->ctrl.fd].ipaddr << ": " << ftpState->ctrl.last_reply); @@ -2392,16 +2379,7 @@ return; } -#if USE_IPV6 -/* FIXME INET6 : ... is it according to PASV mode on IPv6 ?. */ - snprintf(ipaddr, 1024, "%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d", - h1, h2, h3, h4, - h5, h6, h7, h8, - h9, h10, h11, h12, - h13, h14, h15, h16); -#else snprintf(ipaddr, 1024, "%d.%d.%d.%d", h1, h2, h3, h4); -#endif if (!safe_inet_addr(ipaddr, NULL)) { debugs(9, 1, "Unsafe PASV reply from " << @@ -2500,14 +2478,14 @@ x = getsockname(ftpState->ctrl.fd, (struct sockaddr *)&s4addr, &addr_len); addr = s4addr; } - else { #if USE_IPV6 + else { struct sockaddr_in6 s6addr; addr_len = sizeof(struct sockaddr_in6); x = getsockname(ftpState->ctrl.fd, (struct sockaddr *)&s6addr, &addr_len); addr = s6addr; -#endif } +#endif if(x) { debugs(9, 0, "ftpOpenListenSocket: getsockname(" << ftpState->ctrl.fd << ",..): " << xstrerror());