From 577d7528a7bd5ac3350f63ad1a18aa02783c75d3 Mon Sep 17 00:00:00 2001 From: imaginos Date: Fri, 24 Mar 2006 23:04:07 +0000 Subject: [PATCH] appears that sun/solaris has a broken implementation of getaddrinfo git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@711 726aef4b-f618-498e-8847-2d620e286838 --- Csocket.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Csocket.cpp b/Csocket.cpp index 1eafbc6f..a86ccf6a 100644 --- a/Csocket.cpp +++ b/Csocket.cpp @@ -57,8 +57,11 @@ int GetAddrInfo( const CS_STRING & sHostname, Csock *pSock, CSSockAddr & csSockA bool bFoundEntry = false; for( struct addrinfo *pRes = res; pRes; pRes = pRes->ai_next ) { +#ifdef __sun + if( ( pRes->ai_socktype != SOCK_STREAM ) || ( pRes->ai_protocol != IPPROTO_TCP && pRes->ai_protocol != IPPROTO_IP ) ) +#else if( ( pRes->ai_socktype != SOCK_STREAM ) || ( pRes->ai_protocol != IPPROTO_TCP ) ) - continue; +#endif /* __sun work around broken impl of getaddrinfo */ if( ( csSockAddr.GetAFRequire() != CSSockAddr::RAF_ANY ) && ( pRes->ai_family != csSockAddr.GetAFRequire() ) ) continue; // they requested a special type, so be certain we woop past anything unwanted