Skip to content

Commit

Permalink
happy-eyeballs: Specify AI_ADDRCONFIG for getaddrinfo
Browse files Browse the repository at this point in the history
This might help to avoid returning IPv6 addresses on systems without
IPv6 connectivity.

(cherry picked from commit 1e6c375)
  • Loading branch information
notr1ch authored and RytoEX committed Aug 15, 2024
1 parent e494f93 commit 4213643
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions deps/happy-eyeballs/happy-eyeballs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4213643

Please sign in to comment.