summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-01 23:00:18 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-01 23:00:18 +0000
commit858ea80c87d7946cec7d680a48ad326025c70af1 (patch)
tree8566bc4a0aa3123d7a68da14c52b8c73035b8446 /src/socket.cpp
parent8d7b4f5ead4fd1b6f3d307d82d16f877f7428335 (diff)
re-apply ipv6 ifdef tidyup that got pulled in last revert.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7205 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 411465ad6..31fbffb61 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -47,10 +47,8 @@ ListenSocket::ListenSocket(InspIRCd* Instance, int port, char* addr) : ServerIns
if ((!*addr) || (strchr(addr,':')))
this->family = AF_INET6;
else
- this->family = AF_INET;
-#else
- this->family = AF_INET;
#endif
+ this->family = AF_INET;
Instance->SE->AddFd(this);
}
}
@@ -81,14 +79,12 @@ void ListenSocket::HandleEvent(EventType et, int errornum)
length = sizeof(sockaddr_in6);
}
else
+#endif
{
uslen = sizeof(sockaddr_in);
length = sizeof(sockaddr_in);
}
-#else
- uslen = sizeof(sockaddr_in);
- length = sizeof(sockaddr_in);
-#endif
+
incomingSockfd = _accept (this->GetFd(), (sockaddr*)client, &length);
if ((incomingSockfd > -1) && (!_getsockname(incomingSockfd, sock_us, &uslen)))
@@ -101,14 +97,12 @@ void ListenSocket::HandleEvent(EventType et, int errornum)
in_port = ntohs(((sockaddr_in6*)sock_us)->sin6_port);
}
else
+#endif
{
inet_ntop(AF_INET, &((const sockaddr_in*)client)->sin_addr, buf, sizeof(buf));
in_port = ntohs(((sockaddr_in*)sock_us)->sin_port);
}
-#else
- inet_ntop(AF_INET, &((const sockaddr_in*)client)->sin_addr, buf, sizeof(buf));
- in_port = ntohs(((sockaddr_in*)sock_us)->sin_port);
-#endif
+
NonBlocking(incomingSockfd);
if (ServerInstance->Config->GetIOHook(in_port))
{