]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2815] Fix del command
authorSlawek Figiel <slawek@isc.org>
Fri, 7 Apr 2023 17:20:12 +0000 (19:20 +0200)
committerSlawek Figiel <slawek@isc.org>
Thu, 25 May 2023 11:29:29 +0000 (13:29 +0200)
src/lib/dhcpsrv/cfg_hosts.cc

index c21905bf7ec4c05e38d6c933835a5481c542092e..c5d54034bd41674923357c4c4c95b977875a881f 100644 (file)
@@ -1091,8 +1091,10 @@ CfgHosts::del(const SubnetID& subnet_id, const asiolink::IOAddress& addr) {
     size_t erased_addresses = 0;
     if (addr.isV4()) {
         // Delete IPv4 reservation and host.
-        HostContainerIndex1& idx = hosts_.get<1>();
-        erased_hosts = idx.erase(addr);
+        HostContainerIndex4& idx = hosts_.get<4>();
+        for (auto host : getAll4(subnet_id, addr)) {
+            erased_hosts += idx.erase(host->getHostId());
+        }
         erased_addresses = erased_hosts;
     } else {
         HostContainer6Index1& idx6 = hosts6_.get<1>();