cURL / Mailing Lists / curl-library / Single Mail

curl-library

Allow --ftp-port to report non-local IP address (fwd)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 16 Jan 2006 23:53:53 +0100 (CET)

Info from Duane Cathey, forwarded with permission. It is clearly a bug, as it
works with ipv6 disabled but not enabled...

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
---------- Forwarded message ----------
Date: Mon, 16 Jan 2006 15:44:30 -0600
From: Duane Cathey
Subject: RE: Allow --ftp-port to report non-local IP address
Daniel,
   After a little digging around, I found a few references
to IPv6 not playing well with FTP PORT(CURLOPT_FTPPORT).
Here's one of the links:
http://curl.haxx.se/mail/archive-2005-03/0056.html
   But then I also saw release notes that indicated that
the problem(s) was/were fixed in the 7.13.0 version:
Fixed in 7.13.0 - Feb 1 2005
Bugfixes:
     * CURLOPT_FTPPORT and -P work when built ipv6-enabled
   So, I decided I would just try building the app with
IPv6 disabled:
# ./configure --disable-ipv6 --prefix=/usr --with-ssl=/usr/include
   The newly compiled 7.15.1 binary operated as I wished.
I was able to specify a non-local IP address for the -P
argument and have that IP address reported to the server
during the PORT command.  And curl still bound to a local
IP and port for the data connection.
   Here is some version info for my O/S and current curl:
# cat SuSE-release
SUSE LINUX Enterprise Server 9 (i586)
VERSION = 9
# curl --version
curl 7.15.1 (i686-pc-linux-gnu) libcurl/7.15.1 OpenSSL/0.9.7d zlib/1.2.1
Protocols: tftp ftp gopher telnet dict ldap http file https ftps
Features: Largefile NTLM SSL libz
   So, something in the IPv6 code breaks the ability
to use a non-local IP address with the -P argument.
The IPv6 code explicitly attempts to bind to the IP
address provided to the -P argument.  I haven't dug
very deep in the code yet.  And I'm not familiar with
IPv6 yet either.  Maybe you can ask around and see if
someone can find why the IPv6 code behaves differently
than the IPv4 code for the -P argument.
Duane Cathey
Fort Worth, Texas, USA
Received on 2006-01-16