cURL / Mailing Lists / curl-library / Single Mail


Re: [PATCH] FTP EPSV handling on IPv6

From: Daniel Stenberg <>
Date: Thu, 8 Jan 2015 18:33:26 +0100 (CET)

On Wed, 7 Jan 2015, Vojtch Krl wrote:

> The attached patch fixes the problem in a very simple way: In EPSV handling,
> the original hostname is simply copied and resolved again when the data
> connection is being established. It is the same code as if there was a proxy
> so I simply merged the two branches. I'm not sure it's okay to have the
> hostname resolved again - let me know if not.

Thanks for this! I first thought it was a bad idea to resolve the name again -
and the code was written like that to avoid it - but it struck me that for
almost every possible case the name is already resolved and thus in our own
DNS cache anyway so it is a decent fix and simplification of the code.

It also made me aware of another bug: the newhost buffer is of limited size so
if you try this on a very long host name it'll instead try to resolve a cut
off host name and fail in mysterious ways.

I have a slightly larger patch in progress for this, inspired by your version.
I'll just make sure it runs the test suite fine before I post it.

> (Also, it might be a good idea not to fallback to PASV on IPv6 since PASV is
> technically illegal on IPv6.)

Indeed. I'll address that too in a follow-up fix.


List admin:
Received on 2015-01-08