From 7d9d95961babb55f01d6a63e7ad20374bc02ce1c Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Mon, 30 Apr 2007 09:08:20 +0300 Subject: [PATCH] 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." --- src/network/socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/network/socket.c b/src/network/socket.c index d39f874c..70a9abb8 100644 --- a/src/network/socket.c +++ b/src/network/socket.c @@ -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; }