]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2051] Addressed review comments
authorThomas Markwalder <tmark@isc.org>
Thu, 26 Aug 2021 10:37:40 +0000 (06:37 -0400)
committerThomas Markwalder <tmark@isc.org>
Thu, 26 Aug 2021 10:37:40 +0000 (06:37 -0400)
    Minor clean-ups only.

src/hooks/dhcp/lease_cmds/lease_cmds.cc
src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc

index 4191278256b63a337d1c951dd66876a95ed5a0a5..f4e8935587a674d54ac3d00e6ad8cdada007696f 100644 (file)
@@ -732,10 +732,10 @@ LeaseCmdsImpl::leaseAddHandler(CalloutHandle& handle) {
         if (v4) {
             Lease4Parser parser;
             lease4 = parser.parse(config, cmd_args_, force_create);
-
             if (lease4) {
                 bool success;
                 if (!MultiThreadingMgr::instance().getMode()) {
+                    // Not multi-threading.
                     success = LeaseMgrFactory::instance().addLease(lease4);
                 } else {
                     // Multi-threading, try to lock first to avoid a race.
@@ -1838,7 +1838,7 @@ LeaseCmdsImpl::lease6UpdateHandler(CalloutHandle& handle) {
         // The parser does sanity checks (if the address is in scope, if
         // subnet-id is valid, etc)
         lease6 = parser.parse(config, cmd_args_, force_create);
-        bool added;
+        bool added = false;
         if (!MultiThreadingMgr::instance().getMode()) {
             // Not multi-threading.
             added = addOrUpdate6(lease6, force_create);
index 01f5a66799edd39c9b3c09b57751d7363ef20d6c..1fc19f2772c06478a4484181991c8106c10d53aa 100644 (file)
@@ -8927,7 +8927,7 @@ TEST_F(LeaseCmdsTest, testLease6BulkApplyAddConflict) {
     EXPECT_TRUE(lmptr_->getLease6(Lease::TYPE_NA, IOAddress("2001:db8:1::123")));
     EXPECT_TRUE(lmptr_->getLease6(Lease::TYPE_NA, IOAddress("2001:db8:1::124")));
 
-    // Check that the lease for 2001:db8:2::123 was not added.
+    // Check that the lease for locked address was not added.
     EXPECT_FALSE(lmptr_->getLease6(Lease::TYPE_NA, locked_addr));
 
     auto args = rsp->get("arguments");