summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-11-04 13:32:14 +0100
committerDaniel Stenberg <daniel@haxx.se>2017-11-05 10:29:40 +0100
commit9e6d6f6d16d9f1b19de7369315b1a186388b5c0e (patch)
tree66921e50fde1088fc9401aef3be8cc4b5052f844
parent685ef130575cdcf63fe9547757d88a49a40ef281 (diff)
downloadcurl-bagder/connection-ipv6.tar.gz
connect: store IPv6 connection status after valid connectionbagder/connection-ipv6
... previously it would store it already in the happy eyeballs stage which could lead to the IPv6 bit being set for an IPv4 connection, leading to curl not wanting to do EPSV=>PASV for FTP transfers.
-rwxr-xr-xlib/connect.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 218bbcc78..84a63aefd 100755
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -785,6 +785,9 @@ CURLcode Curl_is_connected(struct connectdata *conn,
conn->sock[sockindex] = conn->tempsock[i];
conn->ip_addr = conn->tempaddr[i];
conn->tempsock[i] = CURL_SOCKET_BAD;
+#ifdef ENABLE_IPV6
+ conn->bits.ipv6 = (conn->ip_addr->ai_family == AF_INET6)?TRUE:FALSE;
+#endif
/* close the other socket, if open */
if(conn->tempsock[other] != CURL_SOCKET_BAD) {
@@ -1097,10 +1100,6 @@ static CURLcode singleipconnect(struct connectdata *conn,
return CURLE_OK;
}
-#ifdef ENABLE_IPV6
- conn->bits.ipv6 = (addr.family == AF_INET6)?TRUE:FALSE;
-#endif
-
if(-1 == rc) {
switch(error) {
case EINPROGRESS: