From 2779810ff0d1b66f0fca1a62d6164d70f5c86d06 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 30 May 2007 17:37:13 +0000 Subject: Apply ipv6 #ifdef tidyup patch from djGrrr, thanks :) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7190 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_pgsql.cpp | 5 +---- src/modules/m_cgiirc.cpp | 4 +--- src/modules/m_ident.cpp | 4 +--- src/modules/m_spanningtree/main.cpp | 6 +----- src/modules/m_spanningtree/utils.cpp | 6 +----- 5 files changed, 5 insertions(+), 20 deletions(-) (limited to 'src/modules') diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index 9ec369859..57c049f30 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -817,14 +817,11 @@ class ModulePgSQL : public Module ipvalid = inet_pton(AF_INET6, host.host.c_str(), &blargle); } else +#endif { in_addr blargle; ipvalid = inet_aton(host.host.c_str(), &blargle); } -#else - in_addr blargle; - ipvalid = inet_aton(host.host.c_str(), &blargle); -#endif if(ipvalid > 0) { diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index a866d938d..3ab2f50be 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -385,10 +385,8 @@ public: if (user->GetProtocolFamily() == AF_INET6) inet_pton(AF_INET6, newip, &((sockaddr_in6*)user->ip)->sin6_addr); else - inet_aton(newip, &((sockaddr_in*)user->ip)->sin_addr); -#else - inet_aton(newip, &((sockaddr_in*)user->ip)->sin_addr); #endif + inet_aton(newip, &((sockaddr_in*)user->ip)->sin_addr); try { diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 00d7524c7..eb9f3f365 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -163,10 +163,8 @@ class RFC1413 : public InspSocket if (this->u->GetProtocolFamily() == AF_INET6) snprintf(ident_request,127,"%d,%d\r\n",ntohs(((sockaddr_in6*)sock_them)->sin6_port),ntohs(((sockaddr_in6*)sock_us)->sin6_port)); else - snprintf(ident_request,127,"%d,%d\r\n",ntohs(((sockaddr_in*)sock_them)->sin_port),ntohs(((sockaddr_in*)sock_us)->sin_port)); -#else - snprintf(ident_request,127,"%d,%d\r\n",ntohs(((sockaddr_in*)sock_them)->sin_port),ntohs(((sockaddr_in*)sock_us)->sin_port)); #endif + snprintf(ident_request,127,"%d,%d\r\n",ntohs(((sockaddr_in*)sock_them)->sin_port),ntohs(((sockaddr_in*)sock_us)->sin_port)); this->Write(ident_request); delete[] sock_us; delete[] sock_them; diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 0fddd6e0e..a134d95e1 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -510,16 +510,12 @@ void ModuleSpanningTree::ConnectServer(Link* x) ipvalid = false; } else +#endif { in_addr n; if (inet_aton(x->IPAddr.c_str(),&n) < 1) ipvalid = false; } -#else - in_addr n; - if (inet_aton(x->IPAddr.c_str(),&n) < 1) - ipvalid = false; -#endif /* Do we already have an IP? If so, no need to resolve it. */ if (ipvalid) diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 854e38e76..6c4001503 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -428,16 +428,12 @@ void SpanningTreeUtilities::RefreshIPCache() ipvalid = false; } else +#endif { in_addr n; if (inet_aton(L->IPAddr.c_str(),&n) < 1) ipvalid = false; } -#else - in_addr n; - if (inet_aton(L->IPAddr.c_str(),&n) < 1) - ipvalid = false; -#endif if (!ipvalid) { try -- cgit v1.2.3