summaryrefslogtreecommitdiff
path: root/src/connection.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-18 11:57:57 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-18 11:57:57 +0000
commitfe90d1bc442c0bb6e7e57d2b0df3c1d00626d9a5 (patch)
treea12645516392e0242995c1ec542561e85584c185 /src/connection.cpp
parent2340d03cdf75e85bd2f76c92a1995474af488325 (diff)
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
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);