From 559647a28f52ce10e55a8b12c2992c505e40fa24 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Thu, 27 Mar 2025 21:59:34 -0400 Subject: [PATCH] we didn't have TDU filtering in validate(), just isPeerPermitted() this would let errant TDUs pass in some cases; --- src/fne/network/callhandler/TagP25Data.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/fne/network/callhandler/TagP25Data.cpp b/src/fne/network/callhandler/TagP25Data.cpp index 4074b0cb..2a41b6da 100644 --- a/src/fne/network/callhandler/TagP25Data.cpp +++ b/src/fne/network/callhandler/TagP25Data.cpp @@ -1112,8 +1112,21 @@ bool TagP25Data::validate(uint32_t peerId, lc::LC& control, DUID::E duid, const return true; // always validate a terminator if the source is valid - if (duid == DUID::TDU || duid == DUID::TDULC) - return true; + if (m_network->m_filterTerminators) { + if ((duid == DUID::TDU || duid == DUID::TDULC) && control.getDstId() > 0U) { + lookups::TalkgroupRuleGroupVoice tg = m_network->m_tidLookup->find(control.getDstId()); + if (tg.isInvalid()) { + //LogDebugEx(LOG_NET, "TagP25Data::validate()", "TDU for invalid TGID, dropped, dstId = %u", control.getDstId()); + return false; + } + } + + if (duid == DUID::TDU || duid == DUID::TDULC) + return true; + } else { + if (duid == DUID::TDU || duid == DUID::TDULC) + return true; + } // is this a private call? if (control.getLCO() == LCO::PRIVATE) { @@ -1218,6 +1231,7 @@ bool TagP25Data::validate(uint32_t peerId, lc::LC& control, DUID::E duid, const // check TGID validity lookups::TalkgroupRuleGroupVoice tg = m_network->m_tidLookup->find(control.getDstId()); if (tg.isInvalid()) { + //LogDebugEx(LOG_NET, "TagP25Data::validate()", "dstId = %u, invalid dropped", control.getDstId()); // report error event to InfluxDB if (m_network->m_enableInfluxDB) { influxdb::QueryBuilder()