From 01bd534c8fd64e65238573586e8b78f307e4ed7b Mon Sep 17 00:00:00 2001 From: W3AXL Date: Mon, 19 Feb 2024 18:43:54 -0500 Subject: [PATCH] fixed RID alias updates not working via REST --- src/common/lookups/RadioIdLookup.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/lookups/RadioIdLookup.cpp b/src/common/lookups/RadioIdLookup.cpp index 85cab851..42c0557b 100644 --- a/src/common/lookups/RadioIdLookup.cpp +++ b/src/common/lookups/RadioIdLookup.cpp @@ -83,13 +83,16 @@ void RadioIdLookup::addEntry(uint32_t id, bool enabled, const std::string& alias std::lock_guard lock(m_mutex); try { RadioId _entry = m_table.at(id); - - // if the enabled value doesn't match -- override with the intended - if (_entry.radioEnabled() != enabled) { + // if either the alias or the enabled flag doesn't match, update the entry + if (_entry.radioEnabled() != enabled || _entry.radioAlias() != alias) { + //LogDebug(LOG_HOST, "Updating existing RID %d (%s) in ACL", id, alias.c_str()); _entry = RadioId(enabled, false, alias); m_table[id] = _entry; + } else { + //LogDebug(LOG_HOST, "No changes made to RID %d (%s) in ACL", id, alias.c_str()); } } catch (...) { + //LogDebug(LOG_HOST, "Adding new RID %d (%s) to ACL", id, alias.c_str()); m_table[id] = entry; } }