diff -ur curl-7.12.1/include/curl/curl.h curl-7.12.1.FTP_IGNORE_PASSIVE_IP/include/curl/curl.h
--- curl-7.12.1/include/curl/curl.h	2004-09-10 16:07:27.000000000 -0400
+++ curl-7.12.1.FTP_IGNORE_PASSIVE_IP/include/curl/curl.h	2004-09-22 17:36:45.000000000 -0400
@@ -813,6 +813,9 @@
      of commands with this */
   CINIT(SOURCE_POSTQUOTE, OBJECTPOINT, 128),
 
+  /* Enable/disable bypass of IP address in 227 PASV host response - EJH */
+  CINIT(FTP_IGNORE_PASV_IP, LONG, 129),
+
   CURLOPT_LASTENTRY /* the last unused */
 } CURLoption;
 
diff -ur curl-7.12.1/lib/ftp.c curl-7.12.1.FTP_IGNORE_PASSIVE_IP/lib/ftp.c
--- curl-7.12.1/lib/ftp.c	2004-09-10 16:07:27.000000000 -0400
+++ curl-7.12.1.FTP_IGNORE_PASSIVE_IP/lib/ftp.c	2004-09-22 17:36:43.000000000 -0400
@@ -1509,7 +1509,10 @@
 
     snprintf(newhost, sizeof(newhost),
              "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
-    newhostp = newhost;
+    if (data->set.ftp_ignore_pasv_ip)
+	  newhostp = conn->host.name;
+    else
+      newhostp = newhost;
     newport = (port[0]<<8) + port[1];
   }
   else if (229 == results[modeoff]) {
diff -ur curl-7.12.1/lib/url.c curl-7.12.1.FTP_IGNORE_PASSIVE_IP/lib/url.c
--- curl-7.12.1/lib/url.c	2004-09-10 16:07:27.000000000 -0400
+++ curl-7.12.1.FTP_IGNORE_PASSIVE_IP/lib/url.c	2004-09-22 17:36:43.000000000 -0400
@@ -1355,6 +1355,15 @@
     data->set.tcp_nodelay = (bool)va_arg(param, long);
     break;
 
+  case CURLOPT_FTP_IGNORE_PASV_IP:
+    /*
+    * Enable or disable FTP_IGNORE_PASV_IP, which will disable/enable
+    * the bypass of the IP address in a 227 PASV host response
+    */
+    data->set.ftp_ignore_pasv_ip = (bool)va_arg(param, long);
+    break;
+
+
   /*********** 3rd party transfer options ***********/
   case CURLOPT_SOURCE_HOST:
     /*
diff -ur curl-7.12.1/lib/urldata.h curl-7.12.1.FTP_IGNORE_PASSIVE_IP/lib/urldata.h
--- curl-7.12.1/lib/urldata.h	2004-09-10 16:07:27.000000000 -0400
+++ curl-7.12.1.FTP_IGNORE_PASSIVE_IP/lib/urldata.h	2004-09-22 17:36:44.000000000 -0400
@@ -923,6 +923,7 @@
   bool no_signal;        /* do not use any signal/alarm handler */
   bool global_dns_cache; /* subject for future removal */
   bool tcp_nodelay;      /* whether to enable TCP_NODELAY or not */
+  bool ftp_ignore_pasv_ip; /* whether to ignore IP address in 227 response or not */
 
 };
 
diff -ur curl-7.12.1/src/main.c curl-7.12.1.FTP_IGNORE_PASSIVE_IP/src/main.c
--- curl-7.12.1/src/main.c	2004-09-10 16:07:27.000000000 -0400
+++ curl-7.12.1.FTP_IGNORE_PASSIVE_IP/src/main.c	2004-09-22 17:36:45.000000000 -0400
@@ -319,6 +319,7 @@
     "    --crlf          Convert LF to CRLF in upload",
     " -f/--fail          Fail silently (no output at all) on errors (H)",
     "    --ftp-create-dirs Create the remote dirs if not present (F)",
+    "    --ftp-ignore-pasv-ip Ignore IP address passed in PASV response from host (F)", 
     "    --ftp-pasv      Use PASV instead of PORT (F)",
     "    --ftp-ssl       Enable SSL/TLS for the ftp transfer (F)",
     " -F/--form <name=content> Specify HTTP multipart POST data (H)",
@@ -512,6 +513,7 @@
   bool ftp_ssl;
   char *socks5proxy;
   bool tcp_nodelay;
+  bool ftp_ignore_pasv_ip;
 };
 
 /* global variable to hold info about libcurl */
@@ -1170,6 +1172,7 @@
     {"$d", "tcp-nodelay",FALSE},
     {"$e", "proxy-digest", FALSE},
     {"$f", "proxy-basic", FALSE},
+    {"$g", "ftp-ignore-pasv-ip", FALSE},
     {"0", "http1.0",     FALSE},
     {"1", "tlsv1",       FALSE},
     {"2", "sslv2",       FALSE},
@@ -1505,6 +1508,9 @@
       case 'f': /* --proxy-basic */
         config->proxybasic ^= TRUE;
         break;
+      case 'g': /* --ftp-ignore-pasv-ip */
+        config->ftp_ignore_pasv_ip ^= TRUE;
+        break;
       }
       break;
     case '#': /* added 19990617 larsa */
@@ -3439,6 +3445,8 @@
           curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
         }
 
+        curl_easy_setopt(curl, CURLOPT_FTP_IGNORE_PASV_IP, config->ftp_ignore_pasv_ip);
+
         res = curl_easy_perform(curl);
 
         if((config->progressmode == CURL_PROGRESS_BAR) &&
