]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2815] Remove hosts from all sources
authorSlawek Figiel <slawek@isc.org>
Wed, 24 May 2023 12:36:22 +0000 (14:36 +0200)
committerSlawek Figiel <slawek@isc.org>
Thu, 25 May 2023 11:29:58 +0000 (13:29 +0200)
src/lib/dhcpsrv/host_mgr.cc

index e5cb6e5976653d74e751081f49f34f347f589665..1951e7d870fb95d138a2d94df095ae1ddb3a4224 100644 (file)
@@ -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