feat(trunk): apply per-link TG filter to monitoredTGs in peer roster

The roster trim added in 7cf6589 dropped a peer node entirely when its
*selected* TG was filtered, but a kept node (selected on a permitted TG)
still carried its full monitoredTGs list verbatim in the status blob, so
blacklisted / non-ALLOW_TGS TGs it was only monitoring leaked into
/status.trunks[<section>].nodes[*].monitoredTGs and the MQTT/Redis mirrors.

Filter each entry's monitoredTGs array in TrunkLink::handleMsgPeerNodeList
with the same composite gate as the selected TG and the audio receive path
(isBlacklisted(tg) || isBlacklisted(mapTgIn(tg)) || !isAllowed(tg)), so
TG_MAP translation is honoured and the blacklist wins over an allow-prefix.
Non-permitted and malformed (non-uint) entries are dropped; the array may
become empty. Visibility-only: m_partner_nodes feeds statusJson() and
onPeerNodeList() (MQTT/Redis), never routing.

Adds test_21c_filter_trims_monitored_tgs_in_blob and documents the
monitor-list trim in PEER_PROTOCOL.md.
This commit is contained in:
Audric committed 2026-05-27 13:06:23 +02:00
1 parent 7cf6589a3b
commit 88739d160b
3 files changed
+66 -1

No files matched your search

+4 -1
View File
@@ -554,7 +554,10 @@ 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.)
links have no roster filtering on send, so the trim happens on receive.) The
same gate is then applied to each kept entry's `monitoredTGs` array inside the
status blob (see below), so a node retained because its *selected* TG is
permitted cannot surface filtered TGs it is only monitoring.
The optional `status_blobs[i]` field carries the source reflector's
`m_status["nodes"][callsign]` JSON serialised verbatim — the same rich