Pulled in ipv6 bug fixes

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@637 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2006-02-11 09:44:31 +00:00
parent 4662987fc0
commit 61920317fe
2 changed files with 11 additions and 5 deletions
+9 -3
View File
@@ -69,10 +69,13 @@ int GetHostByName6( const CS_STRING & sHostName, in6_addr * paddr, u_int iNumRet
iReturn = HOST_NOT_FOUND;
#else
hent = gethostbyname2( sHostName.c_str(), AF_INET6 );
PERROR( "gethostbyname" );
if ( hent )
iReturn = 0;
else
{
PERROR( "gethostbyname2" );
}
#endif /* __linux__ */
@@ -110,10 +113,13 @@ int GetHostByName( const CS_STRING & sHostName, in_addr * paddr, u_int iNumRetri
iReturn = HOST_NOT_FOUND;
#else
hent = gethostbyname( sHostName.c_str() );
PERROR( "gethostbyname" );
if ( hent )
iReturn = 0;
else
{
PERROR( "gethostbyname" );
}
#endif /* __linux__ */
@@ -1862,7 +1868,7 @@ int Csock::DNSLookup( EDNSLType eDNSLType )
#ifdef HAVE_IPV6
else
{
iRet = GetHostByName6( m_shostname, m_bindhost.GetAddr6(), 1 );
iRet = GetHostByName6( m_shostname, m_address.GetAddr6(), 1 );
}
#endif /* HAVE_IPV6 */
}
+2 -2
View File
@@ -95,7 +95,7 @@
#ifndef CS_DEBUG
#ifdef __DEBUG__
# define CS_DEBUG( f ) std::cerr << __FILE__ << ":" << __LINE__ << " " << f << endl
# define CS_DEBUG( f ) std::cerr << __FILE__ << ":" << __LINE__ << " " << f << std::endl
#else
# define CS_DEBUG(f) (void)0
#endif /* __DEBUG__ */
@@ -125,7 +125,7 @@ public:
m_bIsIPv6 = false;
memset( (struct sockaddr_in *)&m_saddr, '\0', sizeof( m_saddr ) );
#ifdef HAVE_IPV6
memset( (struct sockaddr_in6 *)&m_saddr, '\0', sizeof( m_saddr6 ) );
memset( (struct sockaddr_in6 *)&m_saddr6, '\0', sizeof( m_saddr6 ) );
#endif /* HAVE_IPV6 */
}
virtual ~CSSockAddr() {}