aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-11-29 21:25:07 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-11-29 21:25:07 +0000
commit0966ddafaa7f044c2a4d972ba416dc4ec96f1ab4 (patch)
treea7200ff4d27c22648e227af0ec447d59e7020ca3 /lib
parentc073625fb905b41703589f2af5e4039db19746f7 (diff)
As reported in Mandrake's bug tracker bug 12285
(http://qa.mandrakesoft.com/show_bug.cgi?id=12285), when connecting to an IPv6 host with FTP, --disable-epsv (or --disable-eprt) effectively disables the ability to transfer a file. Now, when connected to an FTP server with IPv6, these FTP commands can't be disabled even if asked to with the available libcurl options.
Diffstat (limited to 'lib')
-rw-r--r--lib/ftp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index e33f4b38f..47cb361aa 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1184,6 +1184,16 @@ CURLcode ftp_use_port(struct connectdata *conn)
return CURLE_FTP_PORT_FAILED;
}
+#ifdef PF_INET6
+ if(!conn->bits.ftp_use_eprt &&
+ (conn->ip_addr->ai_family == PF_INET6)) {
+ /* EPRT is disabled but we are connected to a IPv6 host, so we ignore the
+ request! */
+ conn->bits.ftp_use_eprt = TRUE;
+ }
+#endif
+
+
for (fcmd = EPRT; fcmd != DONE; fcmd++) {
int lprtaf, eprtaf;
int alen=0, plen=0;
@@ -1512,6 +1522,15 @@ CURLcode ftp_use_pasv(struct connectdata *conn,
char newhost[48];
char *newhostp=NULL;
+#ifdef PF_INET6
+ if(!conn->bits.ftp_use_epsv &&
+ (conn->ip_addr->ai_family == PF_INET6)) {
+ /* EPSV is disabled but we are connected to a IPv6 host, so we ignore the
+ request! */
+ conn->bits.ftp_use_epsv = TRUE;
+ }
+#endif
+
for (modeoff = (conn->bits.ftp_use_epsv?0:1);
mode[modeoff]; modeoff++) {
result = Curl_ftpsendf(conn, "%s", mode[modeoff]);