From 4873461dc4aedd30da6c4d0ed4da5d8ac15e5f47 Mon Sep 17 00:00:00 2001 From: mrbesen Date: Wed, 21 Feb 2024 18:53:01 +0100 Subject: [PATCH] force ipv4 resolve on windows --- resolve.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resolve.c b/resolve.c index ca7cd8b..b8a7430 100644 --- a/resolve.c +++ b/resolve.c @@ -17,6 +17,14 @@ int resolveName(struct sockaddr* addr, socklen_t* addr_len, const char* hostname, int family) { +#ifdef WIN32 + // force ipv4 only on windows -> ipv6 ping is not supprted + if(family == AF_UNSPEC) + { + family = AF_INET; + } +#endif + int result; struct addrinfo* res = NULL;