|
|
@@ -105,12 +105,12 @@ done: |
|
|
|
int resolve_host(struct in_addr *sin_addr, const char *hostname) |
|
|
|
{ |
|
|
|
struct hostent *hp; |
|
|
|
|
|
|
|
|
|
|
|
if (!inet_aton(hostname, sin_addr)) { |
|
|
|
hp = gethostbyname(hostname); |
|
|
|
if (!hp) |
|
|
|
return -1; |
|
|
|
memcpy(sin_addr, hp->h_addr, sizeof(struct in_addr)); |
|
|
|
hp = gethostbyname(hostname); |
|
|
|
if (!hp) |
|
|
|
return -1; |
|
|
|
memcpy(sin_addr, hp->h_addr, sizeof(struct in_addr)); |
|
|
|
} |
|
|
|
return 0; |
|
|
|
} |
|
|
|