--- libelwix/src/net.c 2014/01/29 14:11:45 1.8.12.1 +++ libelwix/src/net.c 2014/02/10 16:43:26 1.9.6.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: net.c,v 1.8.12.1 2014/01/29 14:11:45 misho Exp $ +* $Id: net.c,v 1.9.6.2 2014/02/10 16:43:26 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -242,10 +242,7 @@ e_gethostbyname(const char *psHost, u_short port, sock if (*psHost != '/') { /* resolver */ - if (!addr->sa.sa_family) - host = gethostbyname(psHost); - else - host = gethostbyname2(psHost, addr->sa.sa_family); + host = gethostbyname2(psHost, !strchr(psHost, ':') ? AF_INET : AF_INET6); if (!host) { elwix_SetErr(EINVAL, "Resolver #%d - %s", h_errno, hstrerror(h_errno)); return NULL;