diff --git a/src/svxlink/reflector/Reflector.cpp b/src/svxlink/reflector/Reflector.cpp index c02bec5..4b6dfe7 100644 --- a/src/svxlink/reflector/Reflector.cpp +++ b/src/svxlink/reflector/Reflector.cpp @@ -2368,6 +2368,23 @@ void Reflector::initTrunkLinks(void) 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. @@ -3099,6 +3116,10 @@ std::vector Reflector::collectAllTrunkPrefixes(void) const std::vector all; for (const auto* link : m_trunk_links) { 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; } diff --git a/src/svxlink/reflector/TrunkLink.h b/src/svxlink/reflector/TrunkLink.h index 92c8488..579c025 100644 --- a/src/svxlink/reflector/TrunkLink.h +++ b/src/svxlink/reflector/TrunkLink.h @@ -121,6 +121,10 @@ class TrunkLink : public sigc::trackable { return m_remote_prefix; } + const std::vector& routablePrefixes(void) const + { + return m_routable_prefixes; + } // Read-only view of TGs the peer is interested in (TalkerStart activity // or MsgPeerTgInterest advertisement). Used by Reflector to aggregate // interest for re-advertisement toward the prefix owner.