From: guy Date: Tue, 27 Jan 2004 23:14:25 +0000 (+0000) Subject: Propagate from the main branch X-Git-Tag: tcpdump-3.8.2~37 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/9e45bb1c6ba496032d514656d6467ff525d041d4 Propagate from the main branch 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). --- diff --git a/addrtoname.c b/addrtoname.c index 9075bbc5..58da0329 100644 --- a/addrtoname.c +++ b/addrtoname.c @@ -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;