1
0
Fork 0

Reject incoming YCS audio with the incorrect DG-Id.

ycs232-kbc
Jonathan Naylor 4 years ago
parent 4457fb8e9e
commit d25f13822d

@ -152,7 +152,7 @@ Debug=0
# Local IMRS System Fusion Network # Local IMRS System Fusion Network
Type=IMRS Type=IMRS
Name=South Coast Name=South Coast
Destination=100,44.131.4.1 Destination=75,44.131.4.1
Destination=75,44.131.4.2 Destination=75,44.131.4.2
#RFHangTime=240 #RFHangTime=240
#NetHangTime=240 #NetHangTime=240

@ -18,6 +18,7 @@
#include "YSFDefines.h" #include "YSFDefines.h"
#include "YCSNetwork.h" #include "YCSNetwork.h"
#include "YSFFICH.h"
#include "Utils.h" #include "Utils.h"
#include "Log.h" #include "Log.h"
@ -223,6 +224,18 @@ void CYCSNetwork::clock(unsigned int ms)
m_socket.write(m_info, 80U, m_addr, m_addrLen); m_socket.write(m_info, 80U, m_addr, m_addrLen);
} }
if (::memcmp(buffer, "YSFD", 4U) == 0) {
CYSFFICH fich;
bool valid = fich.decode(buffer + 35U);
if (!valid)
return;
// Reject any audio which doesn't match our requested DG-Id
unsigned char dgId = fich.getDGId();
if (dgId != m_dgId)
return;
}
unsigned char len = length; unsigned char len = length;
m_buffer.addData(&len, 1U); m_buffer.addData(&len, 1U);

Loading…
Cancel
Save