From 1e6c375e95fe982bdeadf671edf1df420dd8d5bc Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Sun, 11 Aug 2024 21:05:48 +0200 Subject: [PATCH] happy-eyeballs: Specify AI_ADDRCONFIG for getaddrinfo This might help to avoid returning IPv6 addresses on systems without IPv6 connectivity. --- shared/happy-eyeballs/happy-eyeballs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/happy-eyeballs/happy-eyeballs.c b/shared/happy-eyeballs/happy-eyeballs.c index 538226ce5..126bae55a 100644 --- a/shared/happy-eyeballs/happy-eyeballs.c +++ b/shared/happy-eyeballs/happy-eyeballs.c @@ -194,6 +194,7 @@ static int build_addr_list(const char *hostname, int port, hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; + hints.ai_flags = AI_ADDRCONFIG; if (context->bind_addr_len == sizeof(struct sockaddr_in)) hints.ai_family = AF_INET;