Skip to content

Commit

Permalink
force ipv4 resolve on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbesen committed Feb 21, 2024
1 parent ed40426 commit 4873461
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4873461

Please sign in to comment.