Skip to content

Commit 9af00a7

Browse files
committed
[#3257] Addressed review comments
Minor cosmetics: modified: src/bin/dhcp4/dhcp4_srv.cc modified: src/bin/dhcp6/dhcp6_srv.cc
1 parent e54baa4 commit 9af00a7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/bin/dhcp4/dhcp4_srv.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2893,8 +2893,9 @@ Dhcpv4Srv::createNameChangeRequests(const Lease4Ptr& lease,
28932893
return;
28942894
}
28952895

2896-
if ((!lease->reuseable_valid_lft_) &&
2897-
(!old_lease || ddns_params.getUpdateOnRenew() || !lease->hasIdenticalFqdn(*old_lease))) {
2896+
if ((lease->reuseable_valid_lft_ == 0) &&
2897+
(!old_lease || ddns_params.getUpdateOnRenew() ||
2898+
!lease->hasIdenticalFqdn(*old_lease))) {
28982899
if (old_lease) {
28992900
// Queue's up a remove of the old lease's DNS (if needed)
29002901
queueNCR(CHG_REMOVE, old_lease);

src/bin/dhcp6/dhcp6_srv.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,8 +2448,8 @@ Dhcpv6Srv::createNameChangeRequests(const Pkt6Ptr& answer,
24482448

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

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

0 commit comments

Comments
 (0)