]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Propagate from the main branch
authorguy <guy>
Tue, 27 Jan 2004 23:14:25 +0000 (23:14 +0000)
committerguy <guy>
Tue, 27 Jan 2004 23:14:25 +0000 (23:14 +0000)
prevent a call to getnameinfo() under cygnus, which doesn't
provide it

(although I think it's actually MinGW that doesn't provide it - the
check is for __MINGW32__, which I think is defined by MinGW but not
Cygwin).

addrtoname.c

index 9075bbc5999b5a3bb398d2fdb8485b72cd00ca45..58da03296139ac1e3a802d2eacdb8b03d678678e 100644 (file)
@@ -23,7 +23,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.96.2.3 2003-12-15 04:02:53 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.96.2.4 2004-01-27 23:14:25 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -103,6 +103,10 @@ win32_gethostbyaddr(const char *addr, int len, int type)
                memset(&addr6, 0, sizeof(addr6));
                addr6.sin6_family = AF_INET6;
                memcpy(&addr6.sin6_addr, addr, len);
+#ifdef __MINGW32__
+               /* MinGW doesn't provide getnameinfo */
+               return NULL;
+#else
                if (getnameinfo((struct sockaddr *)&addr6, sizeof(addr6),
                        hname, sizeof(hname), NULL, 0, 0)) {
                    return NULL;
@@ -110,6 +114,7 @@ win32_gethostbyaddr(const char *addr, int len, int type)
                        strcpy(host.h_name, hname);
                        return &host;
                }
+#endif /* __MINGW32__ */
                break;
        default:
                return NULL;