25 checkLeaseInternal(lease, sanity, subnets);
37 checkLeaseInternal(lease, sanity, subnets);
40 template<
typename LeasePtrType,
typename SubnetsType>
41 void SanityChecker::checkLeaseInternal(LeasePtrType& lease,
const CfgConsistencyPtr& checks,
42 const SubnetsType& subnets) {
48 auto subnet = subnets->getBySubnetId(lease->subnet_id_);
50 if (subnet && subnet->inRange(lease->addr_)) {
59 SubnetID id = findSubnetId(lease, subnets);
61 switch (checks->getLeaseSanityCheck()) {
66 if (lease->subnet_id_ !=
id) {
69 .arg(lease->addr_.toText()).arg(lease->subnet_id_);
74 if (lease->subnet_id_ !=
id) {
79 .arg(lease->addr_.toText()).arg(lease->subnet_id_).arg(
id);
80 lease->subnet_id_ = id;
84 .arg(lease->addr_.toText()).arg(lease->subnet_id_);
90 if (lease->subnet_id_ !=
id) {
95 .arg(lease->addr_.toText()).arg(lease->subnet_id_).arg(
id);
96 lease->subnet_id_ = id;
101 .arg(lease->addr_.toText()).arg(lease->subnet_id_);
108 if (lease->subnet_id_ !=
id) {
110 .arg(lease->addr_.toText()).arg(lease->subnet_id_);
122 template<
typename LeaseType,
typename SubnetsType>
123 SubnetID SanityChecker::findSubnetId(
const LeaseType& lease,
const SubnetsType& subnets) {
126 auto subnet = subnets->selectSubnet(lease->addr_);
131 return (subnet->getID());