aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar attilamolnar2012-05-30 21:27:08 +0200
committerGravatar attilamolnar2012-05-30 21:27:08 +0200
commit2ec16f64bb79cb0f5a66fea9347ca04cfa10f1dc (patch)
treecc5b5d30906be1f6bcbdab703cec6b8071e2219f /src/modules
parentDon't forward SVSJOIN/SVSPART at all if the destination is the same as the so... (diff)
m_spanningtree Interpret ENCAPs also if they were targetted to our SID (retain old behavior)
Drop single targetted ENCAPs if target is reachable via the server who sent the command to us
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/encap.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/encap.cpp b/src/modules/m_spanningtree/encap.cpp
index 1c12e1ed7..98985d431 100644
--- a/src/modules/m_spanningtree/encap.cpp
+++ b/src/modules/m_spanningtree/encap.cpp
@@ -30,7 +30,7 @@ bool TreeSocket::Encap(const std::string &prefix, std::deque<std::string> &param
{
if (params.size() > 1)
{
- if (InspIRCd::Match(ServerInstance->Config->ServerName, params[0]))
+ if (ServerInstance->Config->GetSID() == params[0] || InspIRCd::Match(ServerInstance->Config->ServerName, params[0]))
{
Event event((char*) &params, (Module*)this->Utils->Creator, "encap_received");
event.Send(ServerInstance);
@@ -43,7 +43,16 @@ bool TreeSocket::Encap(const std::string &prefix, std::deque<std::string> &param
Utils->DoOneToAllButSender(prefix, "ENCAP", params, prefix);
}
else
- Utils->DoOneToOne(prefix, "ENCAP", params, params[0]);
+ {
+ /* Only forward when the route to the target is not the same as the sender.
+ * This occurs with 1.2.9 and older servers, as they broadcast ENCAP even when
+ * it is targetted to a single server only.
+ * If we were the only target of this ENCAP, it won't be propagated.
+ */
+ TreeServer* routeserver = Utils->BestRouteTo(params[0]);
+ if ((routeserver) && (routeserver->GetSocket() != this))
+ Utils->DoOneToOne(prefix, "ENCAP", params, params[0]);
+ }
}
return true;
}