we didn't have TDU filtering in validate(), just isPeerPermitted() this would let errant TDUs pass in some cases;

pull/85/head
Bryan Biedenkapp 10 months ago
parent b86a5ce939
commit 559647a28f

@ -1112,8 +1112,21 @@ bool TagP25Data::validate(uint32_t peerId, lc::LC& control, DUID::E duid, const
return true; return true;
// always validate a terminator if the source is valid // always validate a terminator if the source is valid
if (duid == DUID::TDU || duid == DUID::TDULC) if (m_network->m_filterTerminators) {
return true; 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? // is this a private call?
if (control.getLCO() == LCO::PRIVATE) { 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 // check TGID validity
lookups::TalkgroupRuleGroupVoice tg = m_network->m_tidLookup->find(control.getDstId()); lookups::TalkgroupRuleGroupVoice tg = m_network->m_tidLookup->find(control.getDstId());
if (tg.isInvalid()) { if (tg.isInvalid()) {
//LogDebugEx(LOG_NET, "TagP25Data::validate()", "dstId = %u, invalid dropped", control.getDstId());
// report error event to InfluxDB // report error event to InfluxDB
if (m_network->m_enableInfluxDB) { if (m_network->m_enableInfluxDB) {
influxdb::QueryBuilder() influxdb::QueryBuilder()

Loading…
Cancel
Save

Powered by TurnKey Linux.