From 57aa37a7b0b07e55ee8d7e30342cde10cbeeebe1 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 9 Dec 2006 23:04:56 +0000 Subject: Don't allow the user to define a non-existent transport in the tag git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5902 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 2267beb14..7da4dab30 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -4021,8 +4021,7 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind) if ((!transport.empty()) && (hooks.find(transport.c_str()) == hooks.end())) { - ServerInstance->Log(DEFAULT,"m_spanningtree: WARNING: Can't find transport type '%s' for port %s:%s - maybe you forgot\ - to load it BEFORE m_spanningtree in your config file?", + ServerInstance->Log(DEFAULT,"m_spanningtree: WARNING: Can't find transport type '%s' for port %s:%s - maybe you forgot to load it BEFORE m_spanningtree in your config file? - Skipping this port binding", transport.c_str(), IP.c_str(), Port.c_str()); break; } @@ -4064,6 +4063,15 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind) L.HiddenFromStats = Conf->ReadFlag("link","hidden",j); L.Timeout = Conf->ReadInteger("link","timeout",j,true); L.Hook = Conf->ReadValue("link", "transport", j); + + if ((!L.Hook.empty()) && (hooks.find(L.Hook.c_str()) == hooks.end())) + { + ServerInstance->Log(DEFAULT,"m_spanningtree: WARNING: Can't find transport type '%s' for link '%s' - maybe you forgot to load it BEFORE m_spanningtree in your config file? Skipping tag completely.", + L.Hook.c_str(), L.Name.c_str()); + continue; + + } + L.NextConnectTime = time(NULL) + L.AutoConnect; /* Bugfix by brain, do not allow people to enter bad configurations */ if (L.Name != ServerInstance->Config->ServerName) -- cgit v1.2.3