diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-09 23:04:56 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-09 23:04:56 +0000 |
commit | 57aa37a7b0b07e55ee8d7e30342cde10cbeeebe1 (patch) | |
tree | 5f5e23763ac45cf1b7235b01b0f37d0cf7079176 /src/modules/m_spanningtree.cpp | |
parent | 92e6150248f485b6844e3d824ac85be39b0ac69d (diff) |
Don't allow the user to define a non-existent transport in the <link> tag
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5902 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r-- | src/modules/m_spanningtree.cpp | 12 |
1 files 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 <link> 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) |