From fe90d1bc442c0bb6e7e57d2b0df3c1d00626d9a5 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 18 Apr 2004 11:57:57 +0000 Subject: Dns lookup fixes (hands up if you hate DNS) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@642 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/connection.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/connection.cpp b/src/connection.cpp index c4f0a3f72..dc654e655 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -116,7 +116,6 @@ void ircd_connector::SetServerPort(int p) this->port = p; } - bool ircd_connector::MakeOutboundConnection(char* host, int port) { log(DEBUG,"MakeOutboundConnection: Original param: %s",host); @@ -129,9 +128,10 @@ bool ircd_connector::MakeOutboundConnection(char* host, int port) } else { - log(DEBUG,"MakeOutboundConnection: gethostbyname was valid, setting %s",(char *)hoste->h_addr); - this->SetHostAddress((char *)hoste->h_addr,port); - SetHostAndPort((char *)hoste->h_addr,port); + struct in_addr* ia = (in_addr*)hoste->h_addr; + log(DEBUG,"MakeOutboundConnection: gethostbyname was valid, setting %s",inet_ntoa(*ia)); + this->SetHostAddress(inet_ntoa(*ia),port); + SetHostAndPort(inet_ntoa(*ia),port); } this->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); -- cgit v1.2.3