mirror of https://github.com/g4klx/MMDVMHost
Merge pull request #330 from AndyTaylorTweet/master
Account for 8/9 digit DMR IDs in P25 SelfOnly access control.
This commit is contained in:
commit
85bd2f1236
|
|
@ -188,7 +188,23 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len)
|
||||||
unsigned int srcId = m_rfData.getSrcId();
|
unsigned int srcId = m_rfData.getSrcId();
|
||||||
|
|
||||||
if (m_selfOnly) {
|
if (m_selfOnly) {
|
||||||
if (srcId != m_id) {
|
if (m_id > 99999999U) { // Check that the Config DMR-ID is bigger than 8 digits
|
||||||
|
if (srcId != m_id / 100U) {
|
||||||
|
LogMessage("P25, invalid access attempt from %u", srcId);
|
||||||
|
m_rfState = RS_RF_REJECTED;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (m_id > 9999999U) { // Check that the Config DMR-ID is bigger than 7 digits
|
||||||
|
if (srcId != m_id / 10U) {
|
||||||
|
LogMessage("P25, invalid access attempt from %u", srcId);
|
||||||
|
m_rfState = RS_RF_REJECTED;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (srcId != m_id) { // All other cases
|
||||||
LogMessage("P25, invalid access attempt from %u", srcId);
|
LogMessage("P25, invalid access attempt from %u", srcId);
|
||||||
m_rfState = RS_RF_REJECTED;
|
m_rfState = RS_RF_REJECTED;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue