Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-313

FTP: EPRT fails + EPRT/EPSV issues



    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1
    • 2.2
    • FTP
    • None
    • FTP server = vsftpd/Centos 5.4
      FTPClient = commons-net (FTPClient)
      Network = IPv4


      as implemented in NET-288, the client can work now via IPv6 ... EPSV is not only useful on IPv6 but also when NAT is enabled (see RFC 2428)

      what my patch does:

      • (re)enable EPSV command on IPv4 too (i dont know why rwinston@eircom.net removed it from the supplied patch in NET-288), also see my comments in patch
      • sending EPRT only if we are over IPv6, cause there is no advantage over PORT on IPv4, it could even have disadvantages (see comments in patch)
      • EPRT was sending the result of getActivePort() to the server, but when there was no activePortRange set, it did send 0 as default which leads to an error on server site:

        Tue Mar 23 17:17:20 2010 [pid 10581] [ftpuser] FTP command: Client "", "EPRT |1||0|"
        Tue Mar 23 17:17:20 2010 [pid 10581] [ftpuser] FTP response: Client "", "500 Illegal EPRT command."

      • and even calling getActivePort() has no sense here, cause that port is used to be random, but we should send same port where the ServerSocket is listening on -> server.getLocalPort()
      • getActivePort() checks if __activeMaxPort > __activeMinPort, but when i want to set a range of only one single port (min==max) it would return 0 ... now it will check if equal and return __activeMaxPort


        1. ftp_nat.patch
          4 kB
          Felix Bolte



            Unassigned Unassigned
            gockelhahn Felix Bolte
            2 Vote for this issue
            0 Start watching this issue