]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5359] Moved v4 DNS remove logic from alloc engine to the server
authorThomas Markwalder <tmark@isc.org>
Fri, 29 Sep 2017 15:44:32 +0000 (11:44 -0400)
committerThomas Markwalder <tmark@isc.org>
Fri, 29 Sep 2017 15:44:32 +0000 (11:44 -0400)
    Moved logic to test FQDN for differences from AllocEngine::renewLease4()
    to Dhcpv4Srv::createNameChangeRequests(), so it can occur after we
    determine the FQDN for the "new" lease

src/bin/dhcp4/dhcp4_srv.cc
src/lib/dhcpsrv/alloc_engine.cc

index 602bf5efc89198875825672e4374a9665e752b05..218ede368354f793ae78f83bacd40279dd3940d4 100644 (file)
@@ -1667,6 +1667,11 @@ Dhcpv4Srv::createNameChangeRequests(const Lease4Ptr& lease,
                   "NULL lease specified when creating NameChangeRequest");
 
     } else if (!old_lease || !lease->hasIdenticalFqdn(*old_lease)) {
+        if (old_lease) {
+            // Queue's up a remove of the old lease's DNS (if needed)
+            queueNCR(CHG_REMOVE, old_lease);
+        }
+
         // We may need to generate the NameChangeRequest for the new lease. It
         // will be generated only if hostname is set and if forward or reverse
         // update has been requested.
index d4f0141f9a93ef1d9551b2650d6652f4610a65b1..2694580d1a56c3c8c1fe2cbf297d07ec258efe59 100644 (file)
@@ -2995,10 +2995,6 @@ AllocEngine::renewLease4(const Lease4Ptr& lease,
         if (ctx.old_lease_->expired()) {
             reclaimExpiredLease(ctx.old_lease_, ctx.callout_handle_);
 
-        } else if (!lease->hasIdenticalFqdn(*ctx.old_lease_)) {
-            // The lease is not expired but the FQDN information has
-            // changed. So, we have to remove the previous DNS entry.
-            queueNCR(CHG_REMOVE, ctx.old_lease_);
         }
 
         lease->state_ = Lease::STATE_DEFAULT;