From: Slawek Figiel Date: Fri, 7 Apr 2023 17:20:12 +0000 (+0200) Subject: [#2815] Fix del command X-Git-Tag: Kea-2.3.8~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36ed24d1834330066141447af7b98c129612f815;p=thirdparty%2Fkea.git [#2815] Fix del command --- diff --git a/src/lib/dhcpsrv/cfg_hosts.cc b/src/lib/dhcpsrv/cfg_hosts.cc index c21905bf7e..c5d54034bd 100644 --- a/src/lib/dhcpsrv/cfg_hosts.cc +++ b/src/lib/dhcpsrv/cfg_hosts.cc @@ -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>();