summaryrefslogtreecommitdiff
path: root/src/modules/extra
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/modules/extra
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/modules/extra')
-rw-r--r--src/modules/extra/m_mysql.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index e3639436b..7f2b96227 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -667,7 +667,11 @@ class Notifier : public InspSocket
public:
/* Create a socket on a random port. Let the tcp stack allocate us an available port */
+#ifdef IPV6
+ Notifier(Server* S) : InspSocket("::1", 0, true, 3000), Srv(S)
+#else
Notifier(Server* S) : InspSocket("127.0.0.1", 0, true, 3000), Srv(S)
+#endif
{
uslen = sizeof(sock_us);
if (getsockname(this->fd,(sockaddr*)&sock_us,&uslen))
@@ -684,7 +688,11 @@ class Notifier : public InspSocket
/* Using getsockname and ntohs, we can determine which port number we were allocated */
int GetPort()
{
+#ifdef IPV6
+ return ntohs(sock_us.sin6_port);
+#else
return ntohs(sock_us.sin_port);
+#endif
}
virtual int OnIncomingConnection(int newsock, char* ip)
@@ -842,11 +850,18 @@ void* DispatcherThread(void* arg)
log(DEBUG,"Initialize QueueFD to %d",QueueFD);
insp_sockaddr addr;
+
+#ifdef IPV6
+ insp_aton("::1", &addr.sin6_addr);
+ addr.sin6_family = AF_FAMILY;
+ addr.sin6_port = htons(MessagePipe->GetPort());
+#else
insp_inaddr ia;
- inet_aton("127.0.0.1", &ia);
+ insp_aton("127.0.0.1", &ia);
addr.sin_family = AF_FAMILY;
addr.sin_addr = ia;
addr.sin_port = htons(MessagePipe->GetPort());
+#endif
if (connect(QueueFD, (sockaddr*)&addr,sizeof(addr)) == -1)
{