]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3899] Moved checkType() first in addPool()
authorFrancis Dupont <fdupont@isc.org>
Tue, 16 Jun 2015 21:59:18 +0000 (23:59 +0200)
committerFrancis Dupont <fdupont@isc.org>
Tue, 16 Jun 2015 21:59:18 +0000 (23:59 +0200)
src/lib/dhcpsrv/subnet.cc

index dea49fc4524eaae055916d9de59abd6d1e76db07..f4d5c3ec9d6098703128d9a121334883c0c7c901 100644 (file)
@@ -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);
 }