Updated getaddrinfo's hints struct to use AI_ADDRCONFIG to support IPv6 address resolutions

Signed-off-by: Chris Ward <chrisdevward@gmail.com>
This commit is contained in:
Chris Ward 2025-02-19 04:51:30 -05:00
parent bba7246972
commit 98af657f69
1 changed files with 1 additions and 1 deletions

View File

@ -1146,7 +1146,7 @@ int Socket_new(const char* addr, size_t addr_len, int port, SOCKET* sock)
sa_family_t family = AF_INET;
#endif
struct addrinfo *result = NULL;
struct addrinfo hints = {0, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, 0, NULL, NULL, NULL};
struct addrinfo hints = {AI_ADDRCONFIG, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, 0, NULL, NULL, NULL};
FUNC_ENTRY;
*sock = SOCKET_ERROR;