Add fallback AF_INET6 path

This commit is contained in:
twinaphex 2017-12-10 01:19:58 +01:00
parent 7654e8e268
commit d6fd9f0cc1

View File

@ -211,7 +211,13 @@ int getaddrinfo_retro(const char *node, const char *service,
goto error;
in_addr->sin_family = host->h_addrtype;
#ifdef AF_INET6
/* TODO/FIXME - In case we ever want to support IPv6 */
in_addr->sin_addr.s_addr = inet_addr(host->h_addr_list[0]);
#else
memcpy(&in_addr->sin_addr, host->h_addr, host->h_length);
#endif
}
else
goto error;