Previously the bit was set before the connection was found working so if
it would first fail to an ipv6 address and then connect fine to a IPv4
address the variable would still be TRUE.
Reported by: Thomas L. Shinnick
Bug: http://curl.haxx.se/bug/view.cgi?id=
3421912
Curl_persistconninfo(conn);
-#ifdef ENABLE_IPV6
- if(addr.family == AF_INET6)
- conn->bits.ipv6 = TRUE;
-#endif
-
if(data->set.tcp_nodelay)
tcpnodelay(conn, sockfd);
/* we are connected, awesome! */
*connected = TRUE; /* this is a true connect */
infof(data, "connected\n");
+#ifdef ENABLE_IPV6
+ conn->bits.ipv6 = (addr.family == AF_INET6)?TRUE:FALSE;
+#endif
+
Curl_updateconninfo(conn, sockfd);
*sockp = sockfd;
return CURLE_OK;