ftp: Allow PSV mode on IPv6 connections if a proxy is being used #2432

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@lclarkmichalek
Contributor

lclarkmichalek commented Mar 28, 2018

In the situation of a client connecting to an FTP server using an
IPv6 tunnel proxy, the connection info will indicate that the connection
is IPv6. However, because the server behind the proxy is IPv4, it is
permissible to attempt PSV mode. In the case of the FTP server being
IPv4 only, EPSV will always fail, and with the current logic curl will
be unable to connect to the server, as the IPv6 fwdproxy causes curl to
think that EPSV is impossible.

I've tested this privately, using a CONNECT IPv6 proxy to connect to an IPv4 host. I'm not sure if there is a better way to test if the connection is using a proxy (I stole this conditional from the control_address function below this one).

Allow PSV mode on IPv6 connections if a proxy is being used
In the situation of a client connecting to an FTP server using an
IPv6 tunnel proxy, the connection info will indicate that the connection
is IPv6. However, because the server behing the proxy is IPv4, it is
permissable to attempt PSV mode. In the case of the FTP server being
IPv4 only, EPSV will always fail, and with the current logic curl will
be unable to connect to the server, as the IPv6 fwdproxy causes curl to
think that EPSV is impossible.

@lclarkmichalek lclarkmichalek changed the title from Allow PSV mode on IPv6 connections if a proxy is being used to ftp: Allow PSV mode on IPv6 connections if a proxy is being used Mar 28, 2018

@bagder

bagder approved these changes Mar 28, 2018

It looks good and simple enough to me. Thanks!

@bagder

This comment has been minimized.

Show comment Hide comment
@bagder

bagder Apr 6, 2018

Member

Thanks!

Member

bagder commented Apr 6, 2018

Thanks!

@bagder bagder closed this in 5f3938b Apr 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment