summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-06 17:50:32 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-06 17:50:32 +0000
commit87c6e2cf20584c745508fff5802deea1c61727a9 (patch)
tree0d31cb2edff7939c55fea553a7b1cdc585d01d1e
parente15284bcfd25447b0a05029536570b38dc00700e (diff)
ipv6 fixes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6517 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspsocket.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp
index c9c5ba4ec..4aff8f4c5 100644
--- a/src/inspsocket.cpp
+++ b/src/inspsocket.cpp
@@ -99,19 +99,19 @@ InspSocket::InspSocket(InspIRCd* SI, const std::string &ipaddr, int aport, bool
#ifdef IPV6
if (strchr(host,':'))
{
- in6_addr addy;
- if (inet_ntop(AF_INET6, host, &n) < 1)
+ in6_addr n;
+ if (inet_pton(AF_INET6, host, &n) < 1)
ipvalid = false;
}
else
{
- in_addr addy;
- if (inet_aton(host,&addy) < 1)
+ in_addr n;
+ if (inet_aton(host,&n) < 1)
ipvalid = false;
}
#else
- in_addr addy;
- if (inet_aton(host,&addy) < 1)
+ in_addr n;
+ if (inet_aton(host,&n) < 1)
ipvalid = false;
#endif
if (!ipvalid)
@@ -181,8 +181,8 @@ bool InspSocket::BindAddr()
in6_addr n;
if (inet_pton(AF_INET6, IP.c_str(), &n) > 0)
{
- memcpy(((sockaddr_in6*)s)->sin6_addr, &n, sizeof(n));
- s.sin6_family = AF_INET6;
+ memcpy(&((sockaddr_in6*)s)->sin6_addr, &n, sizeof(n));
+ ((sockaddr_in6*)s)->sin6_family = AF_INET6;
size = sizeof(sockaddr_in6);
}
else
@@ -601,14 +601,14 @@ bool InspSocket::Poll()
if ((!*this->host) || strchr(this->host, ':'))
{
char buf[1024];
- recvip = inet_ntop(AF_INET6, ((sockaddr_in6*)client)->sin6_addr, buf, sizeof(buf));
+ recvip = inet_ntop(AF_INET6, &((sockaddr_in6*)client)->sin6_addr, buf, sizeof(buf));
}
else
{
- recvip = insp_ntoa(((sockaddr_in*)client)->sin_addr);
+ recvip = inet_ntoa(((sockaddr_in*)client)->sin_addr);
}
#else
- recvip = insp_ntoa(((sockaddr_in*)client)->sin_addr);
+ recvip = inet_ntoa(((sockaddr_in*)client)->sin_addr);
#endif
this->OnIncomingConnection(incoming, (char*)recvip.c_str());