]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remove some old stuff
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 29 Aug 2008 20:05:28 +0000 (20:05 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 29 Aug 2008 20:05:28 +0000 (20:05 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10348 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree/utils.cpp

index 2b72d581c39e6d56c188af5fec68f43a8cefe101..c0692f542db1a65d21ba340a8ebbf196f5ea58a1 100644 (file)
@@ -502,95 +502,87 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
                }
 
                L.NextConnectTime = time(NULL) + L.AutoConnect;
-               /* Bugfix by brain, do not allow people to enter bad configurations */
-               if (L.Name != ServerInstance->Config->ServerName)
-               {
-                       if (L.Name.find('.') == std::string::npos)
-                               throw CoreException("The link name '"+assign(L.Name)+"' is invalid and must contain at least one '.' character");
 
-                       if (L.Name.length() > 64)
-                               throw CoreException("The link name '"+assign(L.Name)+"' is longer than 64 characters!");
+               if (L.Name.find('.') == std::string::npos)
+                       throw CoreException("The link name '"+assign(L.Name)+"' is invalid and must contain at least one '.' character");
 
-                       if ((!L.IPAddr.empty()) && (!L.RecvPass.empty()) && (!L.SendPass.empty()) && (!L.Name.empty()) && (L.Port))
-                       {
-                               if (Allow.length())
-                                       ValidIPs.push_back(Allow);
+               if (L.Name.length() > 64)
+                       throw CoreException("The link name '"+assign(L.Name)+"' is longer than 64 characters!");
+
+               if ((!L.IPAddr.empty()) && (!L.RecvPass.empty()) && (!L.SendPass.empty()) && (!L.Name.empty()) && (L.Port))
+               {
+                       if (Allow.length())
+                               ValidIPs.push_back(Allow);
 
-                               ValidIPs.push_back(L.IPAddr);
+                       ValidIPs.push_back(L.IPAddr);
 
-                               /* Needs resolving */
-                               bool ipvalid = true;
-                               QueryType start_type = DNS_QUERY_A;
+                       /* Needs resolving */
+                       bool ipvalid = true;
+                       QueryType start_type = DNS_QUERY_A;
 #ifdef IPV6
-                               start_type = DNS_QUERY_AAAA;
-                               if (strchr(L.IPAddr.c_str(),':'))
-                               {
-                                       in6_addr n;
-                                       if (inet_pton(AF_INET6, L.IPAddr.c_str(), &n) < 1)
-                                               ipvalid = false;
-                               }
-                               else
-                               {
-                                       in_addr n;
-                                       if (inet_aton(L.IPAddr.c_str(),&n) < 1)
-                                               ipvalid = false;
-                               }
-#else
+                       start_type = DNS_QUERY_AAAA;
+                       if (strchr(L.IPAddr.c_str(),':'))
+                       {
+                               in6_addr n;
+                               if (inet_pton(AF_INET6, L.IPAddr.c_str(), &n) < 1)
+                                       ipvalid = false;
+                       }
+                       else
+                       {
                                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
-                                       {
-                                               bool cached;
-                                               SecurityIPResolver* sr = new SecurityIPResolver((Module*)this->Creator, this, ServerInstance, L.IPAddr, L, cached, start_type);
-                                               ServerInstance->AddResolver(sr, cached);
-                                       }
-                                       catch (...)
-                                       {
-                                       }
-                               }
-                       }
-                       else
+                       if (!ipvalid)
                        {
-                               if (L.IPAddr.empty())
+                               try
                                {
-                                       L.IPAddr = "*";
-                                       ValidIPs.push_back("*");
-                                       ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block " + assign(L.Name) + " has no IP defined! This will allow any IP to connect as this server, and MAY not be what you want.");
+                                       bool cached;
+                                       SecurityIPResolver* sr = new SecurityIPResolver((Module*)this->Creator, this, ServerInstance, L.IPAddr, L, cached, start_type);
+                                       ServerInstance->AddResolver(sr, cached);
                                }
-
-                               if (L.RecvPass.empty())
-                               {
-                                       throw CoreException("Invalid configuration for server '"+assign(L.Name)+"', recvpass not defined!");
-                               }
-
-                               if (L.SendPass.empty())
+                               catch (...)
                                {
-                                       throw CoreException("Invalid configuration for server '"+assign(L.Name)+"', sendpass not defined!");
                                }
+                       }
+               }
+               else
+               {
+                       if (L.IPAddr.empty())
+                       {
+                               L.IPAddr = "*";
+                               ValidIPs.push_back("*");
+                               ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block " + assign(L.Name) + " has no IP defined! This will allow any IP to connect as this server, and MAY not be what you want.");
+                       }
 
-                               if (L.Name.empty())
-                               {
-                                       throw CoreException("Invalid configuration, link tag without a name! IP address: "+L.IPAddr);
-                               }
+                       if (L.RecvPass.empty())
+                       {
+                               throw CoreException("Invalid configuration for server '"+assign(L.Name)+"', recvpass not defined!");
+                       }
 
-                               if (!L.Port)
-                               {
-                                       ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block " + assign(L.Name) + " has no port defined, you will not be able to /connect it.");
-                               }
+                       if (L.SendPass.empty())
+                       {
+                               throw CoreException("Invalid configuration for server '"+assign(L.Name)+"', sendpass not defined!");
                        }
 
+                       if (L.Name.empty())
+                       {
+                               throw CoreException("Invalid configuration, link tag without a name! IP address: "+L.IPAddr);
+                       }
 
-                       LinkBlocks.push_back(L);
-               }
-               else
-               {
-                       throw CoreException("Invalid configuration for server '"+assign(L.Name)+"', link tag has the same server name as the local server!");
+                       if (!L.Port)
+                       {
+                               ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block " + assign(L.Name) + " has no port defined, you will not be able to /connect it.");
+                       }
                }
+
+               LinkBlocks.push_back(L);
        }
        delete Conf;
 }