Add better validation of DG-ID for DSQ use.
This commit is contained in:
parent
5fa3b8f524
commit
139be054be
1 changed files with 15 additions and 5 deletions
|
@ -154,14 +154,24 @@ bool CYSFControl::writeModem(unsigned char *data, unsigned int len)
|
||||||
if (valid)
|
if (valid)
|
||||||
m_lastFICH = fich;
|
m_lastFICH = fich;
|
||||||
|
|
||||||
// Validate the DSQ value if enabled
|
// Validate the DSQ/DG-ID value if enabled
|
||||||
if (m_sqlEnabled) {
|
if (m_sqlEnabled) {
|
||||||
|
unsigned char cm = m_lastFICH.getCM();
|
||||||
|
if (cm == YSF_CM_GROUP2) {
|
||||||
|
// Using the DG-ID value
|
||||||
|
unsigned char value = m_lastFICH.getSQ();
|
||||||
|
|
||||||
|
if (value != m_sqlValue)
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
// Using the DSQ value
|
||||||
bool sql = m_lastFICH.getSQL();
|
bool sql = m_lastFICH.getSQL();
|
||||||
unsigned char value = m_lastFICH.getSQ();
|
unsigned char value = m_lastFICH.getSQ();
|
||||||
|
|
||||||
if (!sql || value != m_sqlValue)
|
if (!sql || value != m_sqlValue)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Stop repeater packets coming through, unless we're acting as a remote gateway
|
// Stop repeater packets coming through, unless we're acting as a remote gateway
|
||||||
if (m_remoteGateway) {
|
if (m_remoteGateway) {
|
||||||
|
|
Loading…
Reference in a new issue