From fbe21c825a64e5f17fbee3ad210024449c903cbe Mon Sep 17 00:00:00 2001 From: bradh352 Date: Tue, 11 Jul 2023 15:32:59 -0400 Subject: [PATCH] windows get_DNS_Windows port is in network byte order --- src/lib/ares_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/ares_init.c b/src/lib/ares_init.c index 7e27ae83..0ef287f9 100644 --- a/src/lib/ares_init.c +++ b/src/lib/ares_init.c @@ -919,7 +919,7 @@ static int get_DNS_Windows(char **outptr) sizeof(addresses[addressesIndex].text), "[%s]:%u", ipaddr, - namesrvr.sa4->sin_port); + ntohs(namesrvr.sa4->sin_port)); ++addressesIndex; } else if (namesrvr.sa->sa_family == AF_INET6) @@ -956,7 +956,7 @@ static int get_DNS_Windows(char **outptr) sizeof(addresses[addressesIndex].text), "[%s]:%u", ipaddr, - namesrvr.sa4->sin_port); + ntohs(namesrvr.sa4->sin_port)); ++addressesIndex; } else {