From: Slawek Figiel Date: Wed, 24 May 2023 12:36:22 +0000 (+0200) Subject: [#2815] Remove hosts from all sources X-Git-Tag: Kea-2.3.8~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4460128fc4a18dea2e4389d0f0f96d760b28b237;p=thirdparty%2Fkea.git [#2815] Remove hosts from all sources --- diff --git a/src/lib/dhcpsrv/host_mgr.cc b/src/lib/dhcpsrv/host_mgr.cc index e5cb6e5976..1951e7d870 100644 --- a/src/lib/dhcpsrv/host_mgr.cc +++ b/src/lib/dhcpsrv/host_mgr.cc @@ -804,10 +804,12 @@ bool HostMgr::del4(const SubnetID& subnet_id, const Host::IdentifierType& identifier_type, const uint8_t* identifier_begin, const size_t identifier_len, const HostMgrOperationTarget target) { + bool success = false; + if (target & HostMgrOperationTarget::PRIMARY_SOURCE) { if (getCfgHostsForEdit()->del4(subnet_id, identifier_type, identifier_begin, identifier_len)) { - return (true); + success = true; } } @@ -821,11 +823,11 @@ HostMgr::del4(const SubnetID& subnet_id, const Host::IdentifierType& identifier_ for (auto source : alternate_sources_) { if (source->del4(subnet_id, identifier_type, identifier_begin, identifier_len)) { - return (true); + success = true; } } } - return (false); + return (success); } bool @@ -839,10 +841,12 @@ bool HostMgr::del6(const SubnetID& subnet_id, const Host::IdentifierType& identifier_type, const uint8_t* identifier_begin, const size_t identifier_len, const HostMgrOperationTarget target) { + bool success = false; + if (target & HostMgrOperationTarget::PRIMARY_SOURCE) { if (getCfgHostsForEdit()->del6(subnet_id, identifier_type, identifier_begin, identifier_len)) { - return (true); + success = true; } } @@ -856,11 +860,11 @@ HostMgr::del6(const SubnetID& subnet_id, const Host::IdentifierType& identifier_ for (auto source : alternate_sources_) { if (source->del6(subnet_id, identifier_type, identifier_begin, identifier_len)) { - return (true); + success = true; } } } - return (false); + return (success); } bool