diff options
Diffstat (limited to 'libnet/src/libnet_resolve.c')
-rw-r--r-- | libnet/src/libnet_resolve.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libnet/src/libnet_resolve.c b/libnet/src/libnet_resolve.c index 9a78f1f..d565f4a 100644 --- a/libnet/src/libnet_resolve.c +++ b/libnet/src/libnet_resolve.c @@ -117,7 +117,7 @@ libnet_name2addr4(libnet_t *l, char *host_name, uint8_t use_name) struct in_addr addr; struct hostent *host_ent; uint32_t m; - uint val; + uint32_t val; int i; if (use_name == LIBNET_RESOLVE) @@ -127,7 +127,14 @@ libnet_name2addr4(libnet_t *l, char *host_name, uint8_t use_name) if (!(host_ent = gethostbyname(host_name))) { snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, - "%s(): %s\n", __func__, hstrerror(h_errno)); + "%s(): %s\n", __func__, +#if (_WIN32) + "gethostbyname failure" +#else + /* FIXME doesn't exist on windows, needs WSAGetLastError()/FormatMessage */ + hstrerror(h_errno) +#endif + ); /* XXX - this is actually 255.255.255.255 */ return (-1); } |