Skip to content

Commit

Permalink
[#3257] Addressed review comments
Browse files Browse the repository at this point in the history
Minor cosmetics:
	modified:   src/bin/dhcp4/dhcp4_srv.cc
	modified:   src/bin/dhcp6/dhcp6_srv.cc
  • Loading branch information
tmarkwalder committed Nov 19, 2024
1 parent e54baa4 commit 9af00a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/bin/dhcp4/dhcp4_srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2893,8 +2893,9 @@ Dhcpv4Srv::createNameChangeRequests(const Lease4Ptr& lease,
return;
}

if ((!lease->reuseable_valid_lft_) &&
(!old_lease || ddns_params.getUpdateOnRenew() || !lease->hasIdenticalFqdn(*old_lease))) {
if ((lease->reuseable_valid_lft_ == 0) &&
(!old_lease || ddns_params.getUpdateOnRenew() ||
!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);
Expand Down
7 changes: 3 additions & 4 deletions src/bin/dhcp6/dhcp6_srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2448,8 +2448,8 @@ Dhcpv6Srv::createNameChangeRequests(const Pkt6Ptr& answer,

/// @todo IA_NA may contain multiple addresses. We should process
/// each address individually. Currently we only process the first one.
Option6IAAddrPtr iaaddr = boost::static_pointer_cast
<Option6IAAddr>(ia_ctx.ia_rsp_->getOption(D6O_IAADDR));
Option6IAAddrPtr iaaddr = boost::static_pointer_cast<
Option6IAAddr>(ia_ctx.ia_rsp_->getOption(D6O_IAADDR));

// We need an address to create a name-to-address mapping.
// If address is missing for any reason, go to the next IA.
Expand Down Expand Up @@ -2480,7 +2480,7 @@ Dhcpv6Srv::createNameChangeRequests(const Pkt6Ptr& answer,
// The address is the same so this must be renewal. If we're not
// always updating on renew, then we only renew if DNS info has
// changed.
if (l->reuseable_valid_lft_ ||
if ((l->reuseable_valid_lft_ > 0) ||
(!ctx.getDdnsParams()->getUpdateOnRenew() &&
(l->hostname_ == opt_fqdn->getDomainName() &&
l->fqdn_fwd_ == do_fwd && l->fqdn_rev_ == do_rev))) {
Expand Down Expand Up @@ -2667,7 +2667,6 @@ Dhcpv6Srv::assignIA_NA(const Pkt6Ptr& query,
} else {
lease->valid_lft_ = lease->reuseable_valid_lft_;
lease->preferred_lft_ = lease->reuseable_preferred_lft_;
std::cout << __LINE__ << " flagged as resuseable: " << lease->addr_.toText() << std::endl;
ctx.currentIA().reused_leases_.push_back(lease);
LOG_INFO(lease6_logger, DHCP6_LEASE_REUSE)
.arg(query->getLabel())
Expand Down

0 comments on commit 9af00a7

Please sign in to comment.