Skip to content

Commit

Permalink
FTP: if EPSV fails on IPV6 connections, bail out
Browse files Browse the repository at this point in the history
... instead of trying PASV, since PASV can't work with IPv6.

Reported-by: Vojtěch Král
  • Loading branch information
bagder committed Jan 8, 2015
1 parent 9a452ba commit 99e71e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/ftp.c
Expand Up @@ -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;
Expand Down

0 comments on commit 99e71e6

Please sign in to comment.