]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
FTP: allow PASV on IPv6 connections when a proxy is being used
authorLaurie Clark-Michalek <lcm@fb.com>
Wed, 28 Mar 2018 14:42:33 +0000 (15:42 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 6 Apr 2018 12:30:59 +0000 (14:30 +0200)
In the situation of a client connecting to an FTP server using an IPv6
tunnel proxy, the connection info will indicate that the connection is
IPv6. However, because the server behing the proxy is IPv4, it is
permissable to attempt PSV mode. In the case of the FTP server being
IPv4 only, EPSV will always fail, and with the current logic curl will
be unable to connect to the server, as the IPv6 fwdproxy causes curl to
think that EPSV is impossible.

Closes #2432

lib/ftp.c

index 0cc583ba7af55ad0845726b5095a7a9a77c0bb07..ef97d08bbe7eabf3bfe92cce63662e42ba23ecf3 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1788,7 +1788,7 @@ static CURLcode ftp_epsv_disable(struct connectdata *conn)
 {
   CURLcode result = CURLE_OK;
 
-  if(conn->bits.ipv6) {
+  if(conn->bits.ipv6 && !(conn->bits.tunnel_proxy || conn->bits.socksproxy)) {
     /* We can't disable EPSV when doing IPv6, so this is instead a fail */
     failf(conn->data, "Failed EPSV attempt, exiting\n");
     return CURLE_WEIRD_SERVER_REPLY;