aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2023-03-17 17:28:49 +0100
committerDaniel Stenberg <daniel@haxx.se>2023-03-17 22:55:31 +0100
commit138860576fe7d1fd6aa2829d745292f83dd3b475 (patch)
tree64506d73ab6628bb7fa5ef30de098c21bcf77389
parentc3f3c2557c64d4947f8c6337a0590cd28304d8fd (diff)
downloadcurl-138860576fe7d1fd6aa2829d745292f83dd3b475.tar.gz
cf-socket: use port 80 when resolving name for local bind
It turns out c-ares returns an error when asked to resolve a host name with ares_getaddrinfo using port number 0. Reported as a c-ares bug here: https://github.com/c-ares/c-ares/issues/517 The work-around is to simply use port 80 instead, as the number typically does not make a difference and a non-zero number works for c-ares. Fixes #10759 Reported-by: Matt Jolly Closes #10789
-rw-r--r--lib/cf-socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/cf-socket.c b/lib/cf-socket.c
index 86b024ac0..6d9ace426 100644
--- a/lib/cf-socket.c
+++ b/lib/cf-socket.c
@@ -495,7 +495,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
conn->ip_version = CURL_IPRESOLVE_V6;
#endif
- rc = Curl_resolv(data, dev, 0, FALSE, &h);
+ rc = Curl_resolv(data, dev, 80, FALSE, &h);
if(rc == CURLRESOLV_PENDING)
(void)Curl_resolver_wait_resolv(data, &h);
conn->ip_version = ipver;