feat(reflector): explicit routable prefixes join m_all_prefixes for transit (excludes *)
This commit is contained in:
1 parent
1e1d477957
commit
ce08a9886c
2 files changed
+25
No files matched your search
@@ -2368,6 +2368,23 @@ void Reflector::initTrunkLinks(void)
|
|||||||
if (!token.empty()) all_prefixes.push_back(token);
|
if (!token.empty()) all_prefixes.push_back(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Explicit routable prefixes are reachable via this peer and must
|
||||||
|
// participate in mesh-wide longest-prefix-match + hasPrefixRoute so
|
||||||
|
// transit fanout fires for them. "*" is intentionally NOT added — a
|
||||||
|
// wildcard route never transits (loop guard, spec section 5).
|
||||||
|
std::string routable_str;
|
||||||
|
m_cfg->getValue(section, "ROUTABLE_PREFIXES", routable_str);
|
||||||
|
{
|
||||||
|
std::istringstream rs(routable_str);
|
||||||
|
std::string token;
|
||||||
|
while (std::getline(rs, token, ','))
|
||||||
|
{
|
||||||
|
token.erase(0, token.find_first_not_of(" \t"));
|
||||||
|
token.erase(token.find_last_not_of(" \t") + 1);
|
||||||
|
if (!token.empty() && token != "*") all_prefixes.push_back(token);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cache the mesh-wide prefix set for owner-relay decisions.
|
// Cache the mesh-wide prefix set for owner-relay decisions.
|
||||||
@@ -3099,6 +3116,10 @@ std::vector<std::string> Reflector::collectAllTrunkPrefixes(void) const
|
|||||||
std::vector<std::string> all;
|
std::vector<std::string> all;
|
||||||
for (const auto* link : m_trunk_links) {
|
for (const auto* link : m_trunk_links) {
|
||||||
for (const std::string& p : link->remotePrefix()) all.push_back(p);
|
for (const std::string& p : link->remotePrefix()) all.push_back(p);
|
||||||
|
// Explicit routable prefixes (never "*" — m_routable_prefixes excludes it)
|
||||||
|
// must also join the mesh-wide set so hasPrefixRoute / shouldRelayInbound
|
||||||
|
// fire correctly for transit on reload.
|
||||||
|
for (const std::string& p : link->routablePrefixes()) all.push_back(p);
|
||||||
}
|
}
|
||||||
return all;
|
return all;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,6 +121,10 @@ class TrunkLink : public sigc::trackable
|
|||||||
{
|
{
|
||||||
return m_remote_prefix;
|
return m_remote_prefix;
|
||||||
}
|
}
|
||||||
|
const std::vector<std::string>& routablePrefixes(void) const
|
||||||
|
{
|
||||||
|
return m_routable_prefixes;
|
||||||
|
}
|
||||||
// Read-only view of TGs the peer is interested in (TalkerStart activity
|
// Read-only view of TGs the peer is interested in (TalkerStart activity
|
||||||
// or MsgPeerTgInterest advertisement). Used by Reflector to aggregate
|
// or MsgPeerTgInterest advertisement). Used by Reflector to aggregate
|
||||||
// interest for re-advertisement toward the prefix owner.
|
// interest for re-advertisement toward the prefix owner.
|
||||||
|
|||||||
Reference in new issue
Block a user