mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 18:49:03 -04:00
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
This commit is contained in:
parent
df34e808f4
commit
2ec16f64bb
@ -30,7 +30,7 @@ bool TreeSocket::Encap(const std::string &prefix, std::deque<std::string> ¶m
|
||||
{
|
||||
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*) ¶ms, (Module*)this->Utils->Creator, "encap_received");
|
||||
event.Send(ServerInstance);
|
||||
@ -43,7 +43,16 @@ bool TreeSocket::Encap(const std::string &prefix, std::deque<std::string> ¶m
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user