summaryrefslogtreecommitdiff
path: root/extra/resolveip.c
diff options
context:
space:
mode:
Diffstat (limited to 'extra/resolveip.c')
-rw-r--r--extra/resolveip.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/extra/resolveip.c b/extra/resolveip.c
index 0cc89d6e22e..aedc2cc3418 100644
--- a/extra/resolveip.c
+++ b/extra/resolveip.c
@@ -118,13 +118,21 @@ int main(int argc, char **argv)
while (argc--)
{
+#ifndef WIN32
struct in_addr addr;
+#endif
ip = *argv++;
/* Not compatible with IPv6! Probably should use getnameinfo(). */
+#ifdef WIN32
+ taddr = inet_addr(ip);
+ if(taddr != INADDR_NONE)
+ {
+#else
if (inet_aton(ip, &addr) != 0)
{
taddr= addr.s_addr;
+#endif
if (taddr == htonl(INADDR_BROADCAST))
{
puts("Broadcast");