]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1065] addressed review
authorRazvan Becheriu <razvan@isc.org>
Mon, 27 Jul 2020 14:54:42 +0000 (17:54 +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

index 63080cd91a3f2b6aa1fea173453ca9e5cea2cb5b..6222dbf975f92e095853f69a0a1c4f1e907a792a 100644 (file)
@@ -607,8 +607,8 @@ namespace { // anonymous namespace.
 
 bool
 addOrUpdate4(Lease4Ptr lease, bool force_create) {
-    Lease4Ptr lease4 = LeaseMgrFactory::instance().getLease4(lease->addr_);
-    if (force_create && !lease4) {
+    Lease4Ptr existing = LeaseMgrFactory::instance().getLease4(lease->addr_);
+    if (force_create && !existing) {
         // lease does not exist
         if (!LeaseMgrFactory::instance().addLease(lease)) {
             isc_throw(db::DuplicateEntry,
@@ -618,15 +618,15 @@ addOrUpdate4(Lease4Ptr lease, bool force_create) {
         return (true);
     }
     LeaseMgrFactory::instance().updateLease4(lease);
-    LeaseCmdsImpl::updateStatsOnUpdate(lease4, lease);
+    LeaseCmdsImpl::updateStatsOnUpdate(existing, lease);
     return (false);
 }
 
 bool
 addOrUpdate6(Lease6Ptr lease, bool force_create) {
-    Lease6Ptr lease6 =
+    Lease6Ptr existing =
         LeaseMgrFactory::instance().getLease6(lease->type_, lease->addr_);
-    if (force_create && !lease6) {
+    if (force_create && !existing) {
         // lease does not exist
         if (!LeaseMgrFactory::instance().addLease(lease)) {
             isc_throw(db::DuplicateEntry,
@@ -636,7 +636,7 @@ addOrUpdate6(Lease6Ptr lease, bool force_create) {
         return (true);
     }
     LeaseMgrFactory::instance().updateLease6(lease);
-    LeaseCmdsImpl::updateStatsOnUpdate(lease6, lease);
+    LeaseCmdsImpl::updateStatsOnUpdate(existing, lease);
     return (false);
 }