summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/cfg_subnets4.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/dhcpsrv/cfg_subnets4.cc')
-rw-r--r--src/lib/dhcpsrv/cfg_subnets4.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/dhcpsrv/cfg_subnets4.cc b/src/lib/dhcpsrv/cfg_subnets4.cc
index e4aa7bf578..0e47c6d0fc 100644
--- a/src/lib/dhcpsrv/cfg_subnets4.cc
+++ b/src/lib/dhcpsrv/cfg_subnets4.cc
@@ -68,6 +68,13 @@ CfgSubnets4::getByPrefix(const std::string& subnet_text) const {
return ((subnet_it != index.cend()) ? (*subnet_it) : ConstSubnet4Ptr());
}
+bool
+CfgSubnets4::hasSubnetWithServerId(const asiolink::IOAddress& server_id) const {
+ const auto& index = subnets_.get<SubnetServerIdIndexTag>();
+ auto subnet_it = index.find(server_id);
+ return (subnet_it != index.cend());
+}
+
Subnet4Ptr
CfgSubnets4::selectSubnet4o6(const SubnetSelector& selector) const {