feat(trunk): apply per-link TG filter to peer node roster on ingest

BLACKLIST_TGS / ALLOW_TGS previously gated only audio and active-talker traffic on a trunk link; the full client roster (MsgPeerNodeList) was stored verbatim, so a peer node parked on a filtered TG still appeared in /status.trunks[<section>].nodes and the MQTT/Redis mirrors.

Filter each node-list entry in TrunkLink::handleMsgPeerNodeList using the same composite gate as the audio receive path (isBlacklisted(tg) || isBlacklisted(mapTgIn(tg)) || !isAllowed(tg)), so TG_MAP translation is honoured. Filtered entries are dropped entirely. Safe because m_partner_nodes feeds only statusJson() and onPeerNodeList() (MQTT/Redis) -- no routing depends on it.

Adds test_21b_filter_drops_nodes_from_roster and documents the receive-side trim in PEER_PROTOCOL.md and svxreflector.conf.in.
This commit is contained in:
Audric committed 2026-05-25 20:43:09 +02:00
1 parent e3b0b6f3df
commit 7cf6589a3b
4 files changed
+66 -1

No files matched your search

+10
View File
@@ -2044,6 +2044,16 @@ void TrunkLink::handleMsgPeerNodeList(std::istream& is)
continue;
}
e.tg = n.tg;
// Per-link TG filter: a node whose selected TG is blacklisted or falls
// outside ALLOW_TGS on this link is dropped from the roster entirely,
// mirroring the audio/talker receive gate (handleMsgPeerTalkerStart).
// This keeps filtered TGs out of /status, MQTT and the Redis mirror —
// m_partner_nodes feeds statusJson() and onPeerNodeList() only.
if (isBlacklisted(e.tg) || isBlacklisted(mapTgIn(e.tg)) || !isAllowed(e.tg))
{
continue;
}
e.qth_name = sanitizeText(n.qth_name, 64);
// Lat/lon: reject non-finite; drop out-of-range values by zeroing
+3 -1
View File
@@ -121,7 +121,9 @@ CERT_CA_HOOK=@SVX_SHARE_INSTALL_DIR@/ca-hook.py
# component for this link, so set it to a stable, broker-friendly name.
#PEER_ID=reflector-a
# Optional per-trunk TG filters (syntax: exact "26200", prefix "24*",
# range "2427-2438", comma-separated):
# range "2427-2438", comma-separated). These gate audio/talker traffic AND
# trim the peer's node roster shown under /status.trunks[<section>].nodes
# (and its MQTT/Redis mirror), so a filtered TG never pollutes the roster.
#BLACKLIST_TGS=666,777* # never carried in either direction on this link
#ALLOW_TGS=24*,2624123 # if set, ONLY these TGs are exchanged
# Optional bidirectional TG remap (peer_tg:local_tg, comma-separated).