mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 14:35:29 +00:00
[#2815] Implement del in CfgHosts
This commit is contained in:
@@ -1086,10 +1086,18 @@ CfgHosts::add6(const HostPtr& host) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CfgHosts::del(const SubnetID& /*subnet_id*/, const asiolink::IOAddress& /*addr*/) {
|
CfgHosts::del(const SubnetID& subnet_id, const asiolink::IOAddress& addr) {
|
||||||
/// @todo: Implement host removal
|
bool erased = false;
|
||||||
isc_throw(NotImplemented, "sorry, not implemented");
|
if (addr.isV4()) {
|
||||||
return (false);
|
HostContainerIndex1& idx = hosts_.get<1>();
|
||||||
|
erased = idx.erase(addr) != 0;
|
||||||
|
} else {
|
||||||
|
HostContainer6Index1& idx = hosts6_.get<1>();
|
||||||
|
auto range = idx.equal_range(boost::make_tuple(subnet_id, addr));
|
||||||
|
auto eraseIt = idx.erase(range.first, range.second);
|
||||||
|
erased = eraseIt != idx.end();
|
||||||
|
}
|
||||||
|
return (erased);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
|
Reference in New Issue
Block a user