summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/curl/files/curl-7.34.0-fix-ipv6-failover.patch')
-rw-r--r--net-misc/curl/files/curl-7.34.0-fix-ipv6-failover.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/net-misc/curl/files/curl-7.34.0-fix-ipv6-failover.patch b/net-misc/curl/files/curl-7.34.0-fix-ipv6-failover.patch
new file mode 100644
index 000000000000..ce05e239b908
--- /dev/null
+++ b/net-misc/curl/files/curl-7.34.0-fix-ipv6-failover.patch
@@ -0,0 +1,27 @@
+This fixes bug #495170: hangs after hitting IPv6 address with no IPv6
+
+See upstream: https://sourceforge.net/p/curl/bugs/1315/
+
+diff --git a/lib/connect.c b/lib/connect.c
+index 4b6ee00..97a0655 100644
+--- a/lib/connect.c
++++ b/lib/connect.c
+@@ -1104,13 +1104,12 @@ CURLcode Curl_connecthost(struct connectdata *conn, /*
+ conn->tempaddr[0]->ai_next == NULL ? timeout_ms : timeout_ms / 2;
+
+ /* start connecting to first IP */
+- res = singleipconnect(conn, conn->tempaddr[0], &(conn->tempsock[0]));
+- while(res != CURLE_OK &&
+- conn->tempaddr[0] &&
+- conn->tempaddr[0]->ai_next &&
+- conn->tempsock[0] == CURL_SOCKET_BAD)
+- res = trynextip(conn, FIRSTSOCKET, 0);
+-
++ while(conn->tempaddr[0]) {
++ res = singleipconnect(conn, conn->tempaddr[0], &(conn->tempsock[0]));
++ if(res == CURLE_OK)
++ break;
++ conn->tempaddr[0] = conn->tempaddr[0]->ai_next;
++ }
+ if(conn->tempsock[0] == CURL_SOCKET_BAD)
+ return res;