mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:45:49 +08:00
Fixed blacklist/whitelist logic
This commit is contained in:
10
DMRSlot.cpp
10
DMRSlot.cpp
@@ -148,7 +148,7 @@ void CDMRSlot::writeModem(unsigned char *data)
|
|||||||
//AKA - the BlockTheNet modification ;-)
|
//AKA - the BlockTheNet modification ;-)
|
||||||
// - G7RZU
|
// - G7RZU
|
||||||
did = lc->getDstId();
|
did = lc->getDstId();
|
||||||
if (!DstIdBlacklist(did,m_slotNo)) {
|
if (DstIdBlacklist(did,m_slotNo)) {
|
||||||
LogMessage("DMR Slot %u, invalid access attempt to %u (blacklisted)", m_slotNo, did);
|
LogMessage("DMR Slot %u, invalid access attempt to %u (blacklisted)", m_slotNo, did);
|
||||||
delete lc;
|
delete lc;
|
||||||
return;
|
return;
|
||||||
@@ -1336,12 +1336,12 @@ bool CDMRSlot::DstIdBlacklist(unsigned int did, unsigned int slot)
|
|||||||
{
|
{
|
||||||
if (slot == 1) {
|
if (slot == 1) {
|
||||||
if (std::find(m_dstBlackListSlot1.begin(), m_dstBlackListSlot1.end(), did) != m_dstBlackListSlot1.end())
|
if (std::find(m_dstBlackListSlot1.begin(), m_dstBlackListSlot1.end(), did) != m_dstBlackListSlot1.end())
|
||||||
return false;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (std::find(m_dstBlackListSlot2.begin(), m_dstBlackListSlot2.end(), did) != m_dstBlackListSlot2.end())
|
if (std::find(m_dstBlackListSlot2.begin(), m_dstBlackListSlot2.end(), did) != m_dstBlackListSlot2.end())
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//is dst id whitelisted or, if ID is greater than or equal to 4000
|
//is dst id whitelisted or, if ID is greater than or equal to 4000
|
||||||
@@ -1356,7 +1356,7 @@ bool CDMRSlot::DstIdWhitelist(unsigned int did, unsigned int slot, bool gt4k)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(gt4k) {
|
if(gt4k) {
|
||||||
if (std::find(m_dstWhiteListSlot2.begin(), m_dstWhiteListSlot2.end(), did) != m_dstWhiteListSlot2.end() || did >= 4000)
|
if (std::find(m_dstWhiteListSlot2.begin(), m_dstWhiteListSlot2.end(), did) != m_dstWhiteListSlot2.end() || did >= 4000)
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user