Commit 044bb373 authored by Thomas Markwalder's avatar Thomas Markwalder
Browse files

[5359] Moved v4 DNS remove logic from alloc engine to the server

    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
parent e2f7a8c9
......@@ -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.
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment