summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/subnet.cc
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2015-06-16 23:59:18 +0200
committerFrancis Dupont <fdupont@isc.org>2015-06-16 23:59:18 +0200
commit474450807173d1ea7ce28215d3307b6a1db8732b (patch)
treef24d394a5b3986a640b4b1ea32fc97198aef0228 /src/lib/dhcpsrv/subnet.cc
parent[3899] Removed extra space from error message (diff)
downloadkea-474450807173d1ea7ce28215d3307b6a1db8732b.tar.xz
kea-474450807173d1ea7ce28215d3307b6a1db8732b.zip
[3899] Moved checkType() first in addPool()
Diffstat (limited to 'src/lib/dhcpsrv/subnet.cc')
-rw-r--r--src/lib/dhcpsrv/subnet.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/dhcpsrv/subnet.cc b/src/lib/dhcpsrv/subnet.cc
index dea49fc452..f4d5c3ec9d 100644
--- a/src/lib/dhcpsrv/subnet.cc
+++ b/src/lib/dhcpsrv/subnet.cc
@@ -262,6 +262,9 @@ const PoolPtr Subnet::getPool(Lease::Type type, const isc::asiolink::IOAddress&
void
Subnet::addPool(const PoolPtr& pool) {
+ // check if the type is valid (and throw if it isn't)
+ checkType(pool->getType());
+
// Check that the pool is in range with a subnet only if this is
// not a pool of IPv6 prefixes. The IPv6 prefixes delegated for
// the particular subnet don't need to match the prefix of the
@@ -281,9 +284,6 @@ Subnet::addPool(const PoolPtr& pool) {
/// @todo: Check that pools do not overlap
- // check if the type is valid (and throw if it isn't)
- checkType(pool->getType());
-
// Add the pool to the appropriate pools collection
getPoolsWritable(pool->getType()).push_back(pool);
}