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

+11
View File
@@ -545,6 +545,17 @@ or TG change, debounced to 500 ms, and broadcast to every trunk peer. Peers
republish it via MQTT under `nodes/<peer_id>` so a central dashboard can see
who is connected to each reflector.
On ingest the receiver applies that link's per-trunk TG filter
(`BLACKLIST_TGS` / `ALLOW_TGS`) to every entry, using the same match as the
audio/talker receive gate (`isBlacklisted(tg) || isBlacklisted(mapTgIn(tg))
|| !isAllowed(tg)`, so `TG_MAP` translation is honoured). A node whose
selected TG is blacklisted or outside `ALLOW_TGS` is dropped from the roster
entirely, so it never appears under `/status.trunks[<section>].nodes`, MQTT
`nodes/<peer_id>`, or the Redis mirror — a filtered TG's roster is trimmed on
this link just like its audio, even though the full snapshot is sent on the
wire. (Satellite links filter on the *send* side via `SATELLITE_FILTER`; trunk
links have no roster filtering on send, so the trim happens on receive.)
The optional `status_blobs[i]` field carries the source reflector's
`m_status["nodes"][callsign]` JSON serialised verbatim — the same rich
per-client status that local clients expose (rx/tx config, qth array,