aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-01-08 20:43:32 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-01-08 22:32:37 +0100
commit99e71e6a847a72b3e919b1bbaf42963536592913 (patch)
tree578e09dfef740e81f8b2a654844608f654196cde
parent9a452ba3a16bb51249e1d1be5a5b6e47a255c064 (diff)
FTP: if EPSV fails on IPV6 connections, bail out
... instead of trying PASV, since PASV can't work with IPv6. Reported-by: Vojtěch Král
-rw-r--r--lib/ftp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 528b4c13c..68610f958 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1815,6 +1815,13 @@ static CURLcode ftp_state_quote(struct connectdata *conn,
static CURLcode ftp_epsv_disable(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
+
+ if(conn->bits.ipv6) {
+ /* We can't disable EPSV when doing IPv6, so this is instead a fail */
+ failf(conn->data, "Failed EPSV attempt, exiting\n");
+ return CURLE_FTP_WEIRD_SERVER_REPLY;
+ }
+
infof(conn->data, "Failed EPSV attempt. Disabling EPSV\n");
/* disable it for next transfer */
conn->bits.ftp_use_epsv = FALSE;