summaryrefslogtreecommitdiff
path: root/src/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/connection.cpp')
-rw-r--r--src/connection.cpp8
1 files changed, 4 insertions, 4 deletions
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);