From 4662987fc0a6b8bb1d44592860155921a9c12503 Mon Sep 17 00:00:00 2001 From: prozacx Date: Fri, 10 Feb 2006 22:45:44 +0000 Subject: [PATCH] Pulled in changes for resolving ipv6 hosts git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@636 726aef4b-f618-498e-8847-2d620e286838 --- Csocket.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Csocket.cpp b/Csocket.cpp index c5029f14..e1341f77 100644 --- a/Csocket.cpp +++ b/Csocket.cpp @@ -56,8 +56,7 @@ int GetHostByName6( const CS_STRING & sHostName, in6_addr * paddr, u_int iNumRet for( u_int a = 0; a < iNumRetries; a++ ) { memset( (char *)hbuff, '\0', 2048 ); - iReturn = gethostbyname_r( sHostName.c_str(), &hentbuff, hbuff, 2048, &hent, &err ); - + iReturn = gethostbyname2_r( sHostName.c_str(), AF_INET6, &hentbuff, hbuff, 2048, &hent, &err ); if ( iReturn == 0 ) break; @@ -69,7 +68,7 @@ int GetHostByName6( const CS_STRING & sHostName, in6_addr * paddr, u_int iNumRet if ( ( !hent ) && ( iReturn == 0 ) ) iReturn = HOST_NOT_FOUND; #else - hent = gethostbyname( sHostName.c_str() ); + hent = gethostbyname2( sHostName.c_str(), AF_INET6 ); PERROR( "gethostbyname" ); if ( hent )