diff options
author | Francis Dupont <fdupont@isc.org> | 2020-11-12 10:52:12 +0100 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2021-01-11 16:05:46 +0100 |
commit | 64dfcb35039949354efba53f10a35ecca6364bfc (patch) | |
tree | a5fa84bd64fe634eb1885cbd1747218a9b3350db /src/bin | |
parent | [#1418] Checkpoint: preparation code done (diff) | |
download | kea-64dfcb35039949354efba53f10a35ecca6364bfc.tar.xz kea-64dfcb35039949354efba53f10a35ecca6364bfc.zip |
[#1418] Checkpoint: small improvements
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/dhcp6/dhcp6_srv.cc | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 656d291c04..cbae8670f3 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -2072,9 +2072,8 @@ Dhcpv6Srv::assignIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer, .arg(ia->getIAID()) .arg(Lease::lifetimeToText(lease->valid_lft_)); } else { - auto age = lease->valid_lft_ - lease->remaining_valid_lft_; lease->valid_lft_ = lease->remaining_valid_lft_; - lease->preferred_lft_ -= age; + lease->preferred_lft_ = lease->remaining_preferred_lft_; LOG_INFO(lease6_logger, DHCP6_LEASE_REUSE) .arg(query->getLabel()) .arg(lease->addr_.toText()) @@ -2198,9 +2197,8 @@ Dhcpv6Srv::assignIA_PD(const Pkt6Ptr& query, const Pkt6Ptr& /*answer*/, .arg(ia->getIAID()) .arg(Lease::lifetimeToText((*l)->valid_lft_)); } else { - auto age = (*l)->valid_lft_ - (*l)->remaining_valid_lft_; (*l)->valid_lft_ = (*l)->remaining_valid_lft_; - (*l)->preferred_lft_ -= age; + (*l)->preferred_lft_ = (*l)->remaining_preferred_lft_; LOG_INFO(lease6_logger, DHCP6_PD_LEASE_REUSE) .arg(query->getLabel()) .arg((*l)->addr_.toText()) @@ -2357,9 +2355,8 @@ Dhcpv6Srv::extendIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer, .arg((*l)->addr_.toText()) .arg(ia->getIAID()); } else { - auto age = (*l)->valid_lft_ - (*l)->remaining_valid_lft_; (*l)->valid_lft_ = (*l)->remaining_valid_lft_; - (*l)->preferred_lft_ -= age; + (*l)->preferred_lft_ = (*l)->remaining_preferred_lft_; LOG_INFO(lease6_logger, DHCP6_LEASE_REUSE) .arg(query->getLabel()) .arg((*l)->addr_.toText()) @@ -2563,9 +2560,8 @@ Dhcpv6Srv::extendIA_PD(const Pkt6Ptr& query, .arg(static_cast<int>((*l)->prefixlen_)) .arg(ia->getIAID()); } else { - auto age = (*l)->valid_lft_ - (*l)->remaining_valid_lft_; (*l)->valid_lft_ = (*l)->remaining_valid_lft_; - (*l)->preferred_lft_ -= age; + (*l)->preferred_lft_ = (*l)->remaining_preferred_lft_; LOG_INFO(lease6_logger, DHCP6_PD_LEASE_REUSE) .arg(query->getLabel()) .arg((*l)->addr_.toText()) |