summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-01 11:46:19 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-01 11:46:19 +0000
commit4488e477136ea3daa60a744bac272cc37a604136 (patch)
tree49ec2884832cea192feb6a667f9ec8d352c14199 /src/inspircd.cpp
parent4789b3f6536ef8267c79c7cb3ee6678546c2150b (diff)
The IPV6 stuff compiles now, with compile-correct ipv6 code. I dont know if this works yet.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4611 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index b9cd9f36c..57c23b328 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -858,7 +858,11 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
if ((incomingSockfd > -1) && (!getsockname(incomingSockfd,(sockaddr*)&sock_us,&uslen)))
{
+#ifdef IPV6
+ in_port = ntohs(sock_us.sin6_port);
+#else
in_port = ntohs(sock_us.sin_port);
+#endif
log(DEBUG,"Accepted socket %d",incomingSockfd);
/* Years and years ago, we used to resolve here
* using gethostbyaddr(). That is sucky and we
@@ -869,7 +873,11 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
{
try
{
- Config->GetIOHook(in_port)->OnRawSocketAccept(incomingSockfd, inet_ntoa(client.sin_addr), in_port);
+#ifdef IPV6
+ Config->GetIOHook(in_port)->OnRawSocketAccept(incomingSockfd, insp_ntoa(client.sin6_addr), in_port);
+#else
+ Config->GetIOHook(in_port)->OnRawSocketAccept(incomingSockfd, insp_ntoa(client.sin_addr), in_port);
+#endif
}
catch (ModuleException& modexcept)
{
@@ -877,7 +885,11 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
}
}
stats->statsAccept++;
+#ifdef IPV6
+ AddClient(incomingSockfd, in_port, false, client.sin6_addr);
+#else
AddClient(incomingSockfd, in_port, false, client.sin_addr);
+#endif
log(DEBUG,"Adding client on port %lu fd=%lu",(unsigned long)in_port,(unsigned long)incomingSockfd);
}
else