From a4ec7fbfa8311686de86913e614619c56261971d Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Wed, 31 Jan 2024 13:25:37 -0500 Subject: [PATCH] add a check for RTP payload type $57 (which we deprecated) so that its essentially ignored, so people on older versions can abuse the newer software; ensure we don't try to transmit terminators for calls that didn't exist on the first place; --- src/common/network/FrameQueue.cpp | 3 ++- src/fne/network/fne/TagDMRData.cpp | 3 +++ src/fne/network/fne/TagNXDNData.cpp | 3 +++ src/fne/network/fne/TagP25Data.cpp | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/common/network/FrameQueue.cpp b/src/common/network/FrameQueue.cpp index 60f03755..35efa91d 100644 --- a/src/common/network/FrameQueue.cpp +++ b/src/common/network/FrameQueue.cpp @@ -91,7 +91,8 @@ UInt8Array FrameQueue::read(int& messageLength, sockaddr_storage& address, uint3 } // ensure payload type is correct - if (_rtpHeader.getPayloadType() != DVM_RTP_PAYLOAD_TYPE) { + if (_rtpHeader.getPayloadType() != DVM_RTP_PAYLOAD_TYPE || + _rtpHeader.getPayloadType() != DVM_RTP_PAYLOAD_TYPE + 1U) { LogError(LOG_NET, "FrameQueue::read(), invalid RTP payload type received from network"); return nullptr; } diff --git a/src/fne/network/fne/TagDMRData.cpp b/src/fne/network/fne/TagDMRData.cpp index b4b7283e..0c7748cd 100644 --- a/src/fne/network/fne/TagDMRData.cpp +++ b/src/fne/network/fne/TagDMRData.cpp @@ -138,6 +138,9 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId if (std::find_if(m_status.begin(), m_status.end(), [&](StatusMapPair x) { return (x.second.dstId == dstId && x.second.slotNo == slotNo); }) != m_status.end()) { m_status.erase(dstId); } + else { + return false; + } // is this a parrot talkgroup? if so, clear any remaining frames from the buffer lookups::TalkgroupRuleGroupVoice tg = m_network->m_tidLookup->find(dstId); diff --git a/src/fne/network/fne/TagNXDNData.cpp b/src/fne/network/fne/TagNXDNData.cpp index 5f2cc805..c961d99e 100644 --- a/src/fne/network/fne/TagNXDNData.cpp +++ b/src/fne/network/fne/TagNXDNData.cpp @@ -108,6 +108,9 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI if (std::find_if(m_status.begin(), m_status.end(), [&](StatusMapPair x) { return x.second.dstId == dstId; }) != m_status.end()) { m_status.erase(dstId); } + else { + return false; + } // is this a parrot talkgroup? if so, clear any remaining frames from the buffer lookups::TalkgroupRuleGroupVoice tg = m_network->m_tidLookup->find(dstId); diff --git a/src/fne/network/fne/TagP25Data.cpp b/src/fne/network/fne/TagP25Data.cpp index 19d4e816..71801975 100644 --- a/src/fne/network/fne/TagP25Data.cpp +++ b/src/fne/network/fne/TagP25Data.cpp @@ -150,6 +150,9 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId if (std::find_if(m_status.begin(), m_status.end(), [&](StatusMapPair x) { return x.second.dstId == dstId; }) != m_status.end()) { m_status.erase(dstId); } + else { + return false; + } // is this a parrot talkgroup? if so, clear any remaining frames from the buffer lookups::TalkgroupRuleGroupVoice tg = m_network->m_tidLookup->find(dstId);