Respect the user preference

Try to resolve the address using the user-specified ip version and fail
gracefully if the network doesn't support it.
This commit is contained in:
LemonBoy 2015-09-23 15:37:23 +02:00
commit 32c33357d3
8 changed files with 23 additions and 19 deletions

View file

@ -130,7 +130,7 @@ static SERVER_CONNECT_REC *get_server_connect(const char *data, int *plus_addr,
if (host != NULL && *host != '\0') {
IPADDR ip;
if (net_gethostbyname(host, &ip) == 0)
if (net_gethostbyname(host, &ip, conn->family) == 0)
server_connect_own_ip_save(conn, &ip);
}