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
"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.
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;