]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1065] addressed review
authorRazvan Becheriu <razvan@isc.org>
Mon, 27 Jul 2020 16:12:35 +0000 (19:12 +0300)
committerRazvan Becheriu <razvan@isc.org>
Wed, 12 Aug 2020 06:56:43 +0000 (09:56 +0300)
src/hooks/dhcp/lease_cmds/lease_cmds.cc
src/hooks/dhcp/lease_cmds/lease_parser.cc
src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc

index 531803d9b285b6d88e9b85795cc0839c386a2dae..7cfa3f82973fb50d281d1867fa6ec231ce4cc0e7 100644 (file)
@@ -620,13 +620,6 @@ addOrUpdate4(Lease4Ptr lease, bool force_create) {
 
 bool
 addOrUpdate6(Lease6Ptr lease, bool force_create) {
-    /// @todo throw if PD address is in declined state
-    /*
-    if (lease->stateDeclined() && lease->type_ == Lease::TYPE_PD) {
-        isc_throw(isc::InvalidOperation,
-                  "invalid PD address in declined state");
-    }
-    */
     Lease6Ptr existing =
         LeaseMgrFactory::instance().getLease6(lease->type_, lease->addr_);
     if (force_create && !existing) {
@@ -1593,8 +1586,6 @@ LeaseCmdsImpl::lease6BulkApplyHandler(CalloutHandle& handle) {
             // Iterate over all leases.
             for (auto lease : parsed_leases_list) {
 
-                Lease6Parser parser;
-
                 try {
                     if (MultiThreadingMgr::instance().getMode() &&
                         !MultiThreadingMgr::instance().isInCriticalSection()) {
index c8048c6ea6c8aa0abc39abff5607d04eeceb6814..257f7aea191bd90be98efbd0f453ca2492b67c74 100644 (file)
@@ -137,6 +137,14 @@ Lease4Parser::parse(ConstSrvConfigPtr& cfg,
                   "values are: 0 (default), 1 (declined) and 2 (expired-reclaimed)");
     }
 
+    /// @todo throw if PD address is in declined state
+    /*
+    if (state == Lease::STATE_DECLINED && type == Lease::TYPE_PD) {
+        isc_throw(isc::InvalidOperation,
+                  "invalid PD address in declined state");
+    }
+    */
+
     // Handle user context.
     ConstElementPtr ctx = lease_info->get("user-context");
     if (ctx && (ctx->getType() != Element::map)) {
index 8f75d770cbf6d4c29b509a4169e9ea1de6f0f25a..9f1be7369786f7c191cefaff03658080ec53a4ac 100644 (file)
@@ -383,7 +383,7 @@ public:
     /// it 6 times.
     /// @param client_id_pattern value to be used for generating client identifier by
     /// repeating it 8 times.
-    /// @param declined controls weather the lease should be in declined state.
+    /// @param declined controls whether the lease should be in declined state.
     ///
     /// @return Returns the lease created
     Lease4Ptr createLease4(const std::string& ip_address,
@@ -423,7 +423,7 @@ public:
     /// @param subnet_id subnet identifier
     /// @param duid_address_pattern value to be used for generating DUID by
     /// repeating it 8 times
-    /// @param declined controls weather the lease should be in declined state.
+    /// @param declined controls whether the lease should be in declined state.
     ///
     /// @return Returns the lease created
     Lease6Ptr createLease6(const std::string& ip_address,