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