You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_ftp-commits@incubator.apache.org by wr...@apache.org on 2007/02/07 19:34:23 UTC

svn commit: r504656 - in /incubator/mod_ftp/trunk: CHANGES include/mod_ftp.h modules/ftp/ftp_commands.c modules/ftp/mod_ftp.c

Author: wrowe
Date: Wed Feb  7 11:34:23 2007
New Revision: 504656

URL: http://svn.apache.org/viewvc?view=rev&rev=504656
Log:
Good to catch these before first release, we will track the pasv_bindfamily
and use that if FTPPasvBindAddr is specified as an IPv6 family address.

Modified:
    incubator/mod_ftp/trunk/CHANGES
    incubator/mod_ftp/trunk/include/mod_ftp.h
    incubator/mod_ftp/trunk/modules/ftp/ftp_commands.c
    incubator/mod_ftp/trunk/modules/ftp/mod_ftp.c

Modified: incubator/mod_ftp/trunk/CHANGES
URL: http://svn.apache.org/viewvc/incubator/mod_ftp/trunk/CHANGES?view=diff&rev=504656&r1=504655&r2=504656
==============================================================================
--- incubator/mod_ftp/trunk/CHANGES (original)
+++ incubator/mod_ftp/trunk/CHANGES Wed Feb  7 11:34:23 2007
@@ -1,5 +1,10 @@
 Changes post submission, prior to first release;
 
+  * Reorganized PASV command handling and the FTPPasvBindAddr directive
+    to handle IPv6 addresses, especially for the cases of dual-bound
+    adapters, IPv6 tunneled IPv4 connections, and IPv6 servers hiding
+    behind IPv4 load balancing solutions.  [William Rowe]
+
   * Adjust 220 and 215 responses to only quote the same Server: string
     which the HTTP Server: string would display.  This removes the build
     datestamp from 215 responses, and adds Type: L8 to the 215 response. 

Modified: incubator/mod_ftp/trunk/include/mod_ftp.h
URL: http://svn.apache.org/viewvc/incubator/mod_ftp/trunk/include/mod_ftp.h?view=diff&rev=504656&r1=504655&r2=504656
==============================================================================
--- incubator/mod_ftp/trunk/include/mod_ftp.h (original)
+++ incubator/mod_ftp/trunk/include/mod_ftp.h Wed Feb  7 11:34:23 2007
@@ -228,6 +228,7 @@
     apr_fileperms_t fileperms;
     char *pasv_addr;
     char *pasv_bindaddr;
+    int pasv_bindfamily;
     const char *banner_message;
     int banner_message_isfile;
     const char *exit_message;

Modified: incubator/mod_ftp/trunk/modules/ftp/ftp_commands.c
URL: http://svn.apache.org/viewvc/incubator/mod_ftp/trunk/modules/ftp/ftp_commands.c?view=diff&rev=504656&r1=504655&r2=504656
==============================================================================
--- incubator/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
+++ incubator/mod_ftp/trunk/modules/ftp/ftp_commands.c Wed Feb  7 11:34:23 2007
@@ -1388,7 +1388,7 @@
     }
 
     if (fsc->pasv_bindaddr) {
-        apr_sockaddr_info_get(&sa, fsc->pasv_bindaddr, APR_INET,
+        apr_sockaddr_info_get(&sa, fsc->pasv_bindaddr, fsc->pasv_bindfamily,
                               0, 0, c->pool);
     }
     else if (c->local_addr->family == APR_INET) {
@@ -1515,7 +1515,7 @@
     if (fsc->pasv_addr) {
         a = apr_pstrdup(c->pool, fsc->pasv_addr);
     }
-    else if (fsc->pasv_bindaddr) {
+    else if (fsc->pasv_bindaddr && (fsc->pasv_bindfamily == APR_INET)) {
         a = apr_pstrdup(c->pool, fsc->pasv_bindaddr);
     }
     else if ((c->local_addr->family == AF_INET)

Modified: incubator/mod_ftp/trunk/modules/ftp/mod_ftp.c
URL: http://svn.apache.org/viewvc/incubator/mod_ftp/trunk/modules/ftp/mod_ftp.c?view=diff&rev=504656&r1=504655&r2=504656
==============================================================================
--- incubator/mod_ftp/trunk/modules/ftp/mod_ftp.c (original)
+++ incubator/mod_ftp/trunk/modules/ftp/mod_ftp.c Wed Feb  7 11:34:23 2007
@@ -622,7 +622,15 @@
     ftp_server_config *fsc =
         ftp_get_module_config(cmd->server->module_config);
 
-    if ((ftp_inet_pton(AF_INET, addr, &ipaddr)) != 1) {
+    if ((ftp_inet_pton(AF_INET, addr, &ipaddr)) == 1) {
+        fsc->pasv_bindfamily = APR_INET;
+    }
+#if APR_HAVE_IPV6
+    else if ((ftp_inet_pton(AF_INET6, addr, &ipaddr)) == 1) {
+        fsc->pasv_bindfamily = APR_INET6;
+    }
+#endif
+    else {
         return apr_pstrcat(cmd->pool, "Invalid IP address for ",
                            cmd->directive->directive, " (", addr, ")", NULL);
     }