1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-18 01:26:23 -04:00

Revert 2d6840b9, "Only set the socket protocol family on success."

Revert commit 2d6840b9bd9d3a7a45a5ad92b4e98ff7224d6d97.  It is causing
passive FTP via IPv6 to fail on ftp.funet.fi.  ELinks sends PASV and
the server says "425 You cannot use PASV on IPv6 connections. Use EPSV
instead."
This commit is contained in:
Kalle Olavi Niemitalo 2007-04-30 09:08:20 +03:00 committed by Witold Filipczyk
parent 07548d5a75
commit 7d9d95961b

View File

@ -580,23 +580,24 @@ connect_socket(struct socket *csocket, enum connection_state state)
* will fail, as we will use it only when it will be successfully
* established. At least I hope that noone else will want to do
* something else ;-). --pasky */
/* And in fact we must set it early, because of EINPROGRESS. */
#ifdef CONFIG_IPV6
if (family == AF_INET6) {
csocket->protocol_family = EL_PF_INET6;
if (connect(sock, (struct sockaddr *) &addr,
sizeof(struct sockaddr_in6)) == 0) {
/* Success */
csocket->protocol_family = EL_PF_INET6;
complete_connect_socket(csocket, NULL, NULL);
return;
}
} else
#endif
{
csocket->protocol_family = EL_PF_INET;
if (connect(sock, (struct sockaddr *) &addr,
sizeof(struct sockaddr_in)) == 0) {
/* Success */
csocket->protocol_family = EL_PF_INET;
complete_connect_socket(csocket, NULL, NULL);
return;
}