From 819147178db00008a215670992d0f532dd57f9e5 Mon Sep 17 00:00:00 2001 From: danieldg Date: Tue, 1 Sep 2009 15:06:47 +0000 Subject: Strip SUPPORT_IP6LINKS #define git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11572 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cidr.cpp | 5 +---- src/dns.cpp | 7 +------ src/modules/m_connectban.cpp | 6 ------ src/modules/m_spanningtree/capab.cpp | 18 ++---------------- src/modules/m_spanningtree/uid.cpp | 2 -- src/usermanager.cpp | 30 ------------------------------ src/users.cpp | 10 ---------- 7 files changed, 4 insertions(+), 74 deletions(-) (limited to 'src') diff --git a/src/cidr.cpp b/src/cidr.cpp index 040681766..d38056b02 100644 --- a/src/cidr.cpp +++ b/src/cidr.cpp @@ -121,7 +121,6 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr return false; } -#ifdef SUPPORT_IP6LINKS in6_addr address_in6; in6_addr mask_in6; @@ -143,9 +142,7 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr return false; } } - else -#endif - if (inet_pton(AF_INET, address_copy.c_str(), &address_in4) > 0) + else if (inet_pton(AF_INET, address_copy.c_str(), &address_in4) > 0) { if (inet_pton(AF_INET, cidr_copy.c_str(), &mask_in4) > 0) { diff --git a/src/dns.cpp b/src/dns.cpp index 75108d577..79a2e2473 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -550,7 +550,7 @@ int DNS::GetNameForce(const char *ip, ForceProtocol fp) DNSHeader h; int id; int length; -#ifdef SUPPORT_IP6LINKS + if (fp == PROTOCOL_IPV6) { in6_addr i; @@ -563,7 +563,6 @@ int DNS::GetNameForce(const char *ip, ForceProtocol fp) return -1; } else -#endif { in_addr i; if (inet_aton(ip, &i)) @@ -591,7 +590,6 @@ int DNS::GetNameForce(const char *ip, ForceProtocol fp) */ void DNS::MakeIP6Int(char* query, const in6_addr *ip) { -#ifdef SUPPORT_IP6LINKS const char* hex = "0123456789abcdef"; for (int index = 31; index >= 0; index--) /* for() loop steps twice per byte */ { @@ -604,9 +602,6 @@ void DNS::MakeIP6Int(char* query, const in6_addr *ip) *query++ = '.'; /* Seperator */ } strcpy(query,"ip6.arpa"); /* Suffix the string */ -#else - *query = 0; -#endif } /** Return the next id which is ready, and the result attached to it */ diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp index 19408046f..524edb8a5 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -74,17 +74,11 @@ class ModuleConnectBan : public Module switch (u->GetProtocolFamily()) { - #ifdef SUPPORT_IP6LINKS case AF_INET6: - { range = ipv6_cidr; - } break; - #endif case AF_INET: - { range = ipv4_cidr; - } break; } diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index aa4ab5e03..7c37e67eb 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -65,12 +65,8 @@ void TreeSocket::SendCapabilities() this->WriteLine(line); int ip6 = 0; - int ip6support = 0; #ifdef IPV6 ip6 = 1; -#endif -#ifdef SUPPORT_IP6LINKS - ip6support = 1; #endif std::string extra; /* Do we have sha256 available? If so, we send a challenge */ @@ -92,7 +88,7 @@ void TreeSocket::SendCapabilities() " MAXGECOS="+ConvToStr(ServerInstance->Config->Limits.MaxGecos)+ " MAXAWAY="+ConvToStr(ServerInstance->Config->Limits.MaxAway)+ " IP6NATIVE="+ConvToStr(ip6)+ - " IP6SUPPORT="+ConvToStr(ip6support)+ + " IP6SUPPORT=1"+ " PROTOCOL="+ConvToStr(ProtocolVersion)+extra+ " PREFIX="+ServerInstance->Modes->BuildPrefixes()+ " CHANMODES="+ServerInstance->Modes->GiveModeList(MASK_CHANNEL)+ @@ -148,13 +144,7 @@ bool TreeSocket::Capab(const std::deque ¶ms) else if (params[0] == "END") { std::string reason; - int ip6support = 0; -#ifdef SUPPORT_IP6LINKS - ip6support = 1; -#endif - /* Compare ModuleList and check CapKeys... - * Maybe this could be tidier? -- Brain - */ + /* Compare ModuleList and check CapKeys */ if ((this->ModuleList != this->MyCapabilities()) && (this->ModuleList.length())) { std::string diffIneed = ListDifference(this->ModuleList, this->MyCapabilities()); @@ -174,10 +164,6 @@ bool TreeSocket::Capab(const std::deque ¶ms) this->SendError("CAPAB negotiation failed: "+reason); return false; } - if (((this->CapKeys.find("IP6SUPPORT") == this->CapKeys.end()) && (ip6support)) || ((this->CapKeys.find("IP6SUPPORT") != this->CapKeys.end()) && (this->CapKeys.find("IP6SUPPORT")->second != ConvToStr(ip6support)))) - reason = "We don't both support linking to IPV6 servers"; - if (((this->CapKeys.find("IP6NATIVE") != this->CapKeys.end()) && (this->CapKeys.find("IP6NATIVE")->second == "1")) && (!ip6support)) - reason = "The remote server is IPV6 native, and we don't support linking to IPV6 servers"; if (this->CapKeys.find("PROTOCOL") == this->CapKeys.end()) { reason = "Protocol version not specified"; diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index f8efbfd24..40f8e18ab 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -157,11 +157,9 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque &pa if (params[8][0] != '+') params[8] = "+" + params[8]; -#ifdef SUPPORT_IP6LINKS if (params[6].find_first_of(":") != std::string::npos) _new->SetSockAddr(AF_INET6, params[6].c_str(), 0); else -#endif _new->SetSockAddr(AF_INET, params[6].c_str(), 0); ServerInstance->Users->AddGlobalClone(_new); diff --git a/src/usermanager.cpp b/src/usermanager.cpp index da8061fba..0ebf1f6c7 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -222,17 +222,11 @@ void UserManager::AddLocalClone(User *user) clonemap::iterator x; switch (user->GetProtocolFamily()) { -#ifdef SUPPORT_IP6LINKS case AF_INET6: - { range = ServerInstance->Config->c_ipv6_range; - } break; -#endif case AF_INET: - { range = ServerInstance->Config->c_ipv4_range; - } break; } @@ -249,17 +243,11 @@ void UserManager::AddGlobalClone(User *user) clonemap::iterator x; switch (user->GetProtocolFamily()) { -#ifdef SUPPORT_IP6LINKS case AF_INET6: - { range = ServerInstance->Config->c_ipv6_range; - } break; -#endif case AF_INET: - { range = ServerInstance->Config->c_ipv4_range; - } break; } @@ -275,17 +263,11 @@ void UserManager::RemoveCloneCounts(User *user) int range = 32; switch (user->GetProtocolFamily()) { -#ifdef SUPPORT_IP6LINKS case AF_INET6: - { range = ServerInstance->Config->c_ipv6_range; - } break; -#endif case AF_INET: - { range = ServerInstance->Config->c_ipv4_range; - } break; } @@ -315,17 +297,11 @@ unsigned long UserManager::GlobalCloneCount(User *user) int range = 32; switch (user->GetProtocolFamily()) { -#ifdef SUPPORT_IP6LINKS case AF_INET6: - { range = ServerInstance->Config->c_ipv6_range; - } break; -#endif case AF_INET: - { range = ServerInstance->Config->c_ipv4_range; - } break; } clonemap::iterator x = global_clones.find(user->GetCIDRMask(range)); @@ -340,17 +316,11 @@ unsigned long UserManager::LocalCloneCount(User *user) int range = 32; switch (user->GetProtocolFamily()) { -#ifdef SUPPORT_IP6LINKS case AF_INET6: - { range = ServerInstance->Config->c_ipv6_range; - } break; -#endif case AF_INET: - { range = ServerInstance->Config->c_ipv4_range; - } break; } clonemap::iterator x = local_clones.find(user->GetCIDRMask(range)); diff --git a/src/users.cpp b/src/users.cpp index b3e6ef58f..f210ed470 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -272,12 +272,10 @@ User::~User() { delete (sockaddr_in*)ip; } -#ifdef SUPPORT_IP6LINKS else { delete (sockaddr_in6*)ip; } -#endif } ServerInstance->Users->uuidlist->erase(uuid); @@ -1080,7 +1078,6 @@ void User::SetSockAddr(int protocol_family, const char* sip, int port) switch (protocol_family) { -#ifdef SUPPORT_IP6LINKS case AF_INET6: { sockaddr_in6* sin = new sockaddr_in6; @@ -1090,7 +1087,6 @@ void User::SetSockAddr(int protocol_family, const char* sip, int port) this->ip = (sockaddr*)sin; } break; -#endif case AF_INET: { sockaddr_in* sin = new sockaddr_in; @@ -1113,14 +1109,12 @@ int User::GetPort() switch (this->GetProtocolFamily()) { -#ifdef SUPPORT_IP6LINKS case AF_INET6: { sockaddr_in6* sin = (sockaddr_in6*)this->ip; return sin->sin6_port; } break; -#endif case AF_INET: { sockaddr_in* sin = (sockaddr_in*)this->ip; @@ -1158,7 +1152,6 @@ const char* User::GetCIDRMask(int range) */ switch (this->GetProtocolFamily()) { -#ifdef SUPPORT_IP6LINKS case AF_INET6: { /* unsigned char s6_addr[16]; */ @@ -1207,7 +1200,6 @@ const char* User::GetCIDRMask(int range) return buf; } break; -#endif case AF_INET: { struct in_addr v4; @@ -1261,7 +1253,6 @@ const char* User::GetIPString() switch (this->GetProtocolFamily()) { -#ifdef SUPPORT_IP6LINKS case AF_INET6: { static char temp[1024]; @@ -1281,7 +1272,6 @@ const char* User::GetIPString() return buf; } break; -#endif case AF_INET: { sockaddr_in* sin = (sockaddr_in*)this->ip; -- cgit v1.2.3