- max attempts set to 0 in unit-tests (matching production code)
- couple typos
- new unit-test added (selectSharedNetworkByRelayAddressSubnetLevel)
- ClientContext4 is now noncopyable
- unused network parameter removed
src/lib/dhcpsrv/alloc_engine.cc
AllocEngine::updateLeaseData() - added logic to set lease state
to default and increment assigned stat if the lease is expired-reclaimed
src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc
TEST_F(AllocEngine6Test, requestReuseDeclinedLease6Stats) - new test
to verify the behavior
doc/guide/dhcp4-srv.xml
doc/guide/dhcp6-srv.xml
Added entries for reclaimed-leases
src/lib/dhcpsrv/alloc_engine.cc
AllocEngine::reuseExpiredLease(Lease6Ptr&...) - increment
assigned-<nas/pds> for real allocations
AllocEngine::extendLease6() - increment assigned-<nas/pds>
for real allocations if the lease expired
AllocEngine::renewLease4(const Lease4Ptr&...)
- set lease state to STATE_DEFAULT for real allocations
- increment assigned-leases if lease is expired or reclaimed
for real allocations
AllocEngine::reuseExpiredLease4(Lease4Ptr&...)
- increment assigned-leases for real allocations
src/lib/dhcpsrv/cfg_subnets4.cc
CfgSubnets4::removeStatistics() - added "reclaimed-leases"
src/lib/dhcpsrv/cfg_subnets6.cc
CfgSubnets4::removeStatistics() - added "reclaimed-leases"
src/lib/dhcpsrv/lease_mgr.cc
LeaseMgr::recountLeaseStats4()
LeaseMgr::recountLeaseStats6()
- added handling of "reclaimed-leases"
- fixed name of "reclaimed-declined-addresses"
src/lib/dhcpsrv/tests/alloc_engine4_unittest.cc
TEST_F(AllocEngine4Test, simpleRenew4) - new test to verify stats
on a normal renew, non-expired
Added EXPECT_TRUE around calls to testStatistics for invocation line numbers
Added stat checks to several tests
src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc
Added EXPECT_TRUE around calls to testStatistics for invocation line numbers
Added stat checks to several tests
src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc
Added checks of assigned stats
src/lib/dhcpsrv/tests/alloc_engine_utils.cc
AllocEngine6Test::initSubnet() - removed artificial stat values
NakedAllocEngine::addHost() - new method to add a host to the
current configuration, rather than use staging/commit as the latter
This is solution #2:
src/lib/dhcpsrv/alloc_engine.h
src/lib/dhcpsrv/alloc_engine.cc
AllocEngine::extendLease6() - replaced logic to set the context flags with
simply adding the original lease to the changed_leases_ list.
AllocEngine::updateLeaseData() - removed logic to set the context flags.
src/bin/dhcp6/dhcp6_srv.cc
Dhcpv6Srv::createNameChangeRequests() - replaced the context flag check
with logic which looks for candidate IA addresses in the ctx.changed_leases_
list. If found and the FDQN doman name has not changed, we move on to the
next candidate.
src/bin/dhcp6/tests/fqdn_unittest.cc
TEST_F(FqdnDhcpv6SrvTest, createNameChangeRequestsNoAddr) - removed
testing of context flag permutations
src/lib/dhcpsrv/alloc_engine.h
src/lib/dhcpsrv/alloc_engine.cc
- AllocEngine::extendLease6()
- AllocEngine::updateLeaseData() - logic was added to clear the context
DNS update flags when the renewal does not alter the lease's FQDN.
src/bin/dhcp6/dhcp6_srv.h
src/bin/dhcp6/dhcp6_srv.cc
- Dhcpv6Srv::createNameChangeRequests() - added context as second parameter,
and modified function to return without creating NCR(s) if both update flags
in the context are false.
src/bin/dhcp6/tests/fqdn_unittest.cc
- TEST_F(FqdnDhcpv6SrvTest, createNameChangeRequests) - modified to verify
combinations of context update flags
- TEST_F(FqdnDhcpv6SrvTest, DISABLED_processTwoRequests) - renamed
to TEST_F(FqdnDhcpv6SrvTest, processTwoRequestsDiffFqdn) and enabled.
It had been disabled pending 3677 which has been completed.
- TEST_F(FqdnDhcpv6SrvTest, processTwoRequestsSameFqdn) - new test
which verifies that client "renewing" a lease by sending a second
request with the different FQDN generates the correct NCRs
- TEST_F(FqdnDhcpv6SrvTest, DISABLED_processRequestRenew) - renamed
to TEST_F(FqdnDhcpv6SrvTest, processRequestRenewDiffFqdn) and enabled.
It had been disabled pending 3677 which has been completed.
- TEST_F(FqdnDhcpv6SrvTest, processRequestRenewSameFqdn) - new test
which verifies that client renewing a lease by sending a renew
with the same FQDN does NOT generate any NCRs
If IA contains allocated lease for which there is a reservation
the liftime of this lease is extended. Any newly reserved
lease will be assigned to a different IA, possibly replacing
dynamically allocated lease.
The client packet is now uniformly available to all client packet driven
callouts for both v4 and v6:
Added "query4" to lease4_select and lease4_renew
src/bin/dhcp4/dhcp4_hooks.dox
Added query4 argument to lease4_select and lease4_renew documentation
src/bin/dhcp4/tests/hooks_unittest.cc
Revamped to track both query4 and response4 arguments
TEST_F(HooksDhcpv4SrvTest, lease4RenewSimple) - modified to verify
query4 set by lease4_renew callout
src/lib/dhcpsrv/alloc_engine.cc
- AllocEngine::createLease4()
- AllocEngine::reuseExpiredLease4() - modified to add query4 to
lease4_select callout arguments
- AllocEngine::renewLease4() - modified to add query4 to lease4_renew
callout arguments
src/lib/dhcpsrv/tests/alloc_engine_hooks_unittest.cc
HookAllocEngine4Test() - modified to track query4 argument
TEST_F(HookAllocEngine4Test, lease4_select) - modified to verify query4
callout argument
Added "query6" to pkt6_send and lease6_select
src/bin/dhcp6/dhcp6_hooks.dox
Added query6 argument to pkt6_send and lease6_select documentation
src/bin/dhcp6/dhcp6_srv.cc
Dhcpv6Srv::processPacket(Pkt6Ptr& query, Pkt6Ptr& rsp) - modified to
add query6 to the pkt_send callout arguments
src/bin/dhcp6/tests/hooks_unittest.cc
Revamped to track both query4 and response4 arguments
TEST_F(HooksDhcpv6SrvTest, simplePkt6Send) - modified to
verify query6 set by pkt6_send callout
src/lib/dhcpsrv/alloc_engine.cc
- AllocEngine::createLease4()
- AllocEngine::reuseExpiredLease6() - modified to add query6 to
lease6_select callout arguments
callout arguments
src/lib/dhcpsrv/tests/alloc_engine_hooks_unittest.cc
HookAllocEngine6Test() - modified to track query6 argument
TEST_F(HookAllocEngine6Test, lease4_select) - modified to verify
query6 argument
src/lib/dhcpsrv/alloc_engine.cc
- AllocEngine::reclaimExpiredLease(const Lease6Ptr& lease,
const DbReclaimMode& reclaim_mode,
const CalloutHandlePtr& callout_handle)
Simplified logic for flagging a lease for removal. Renamed "remove_tmp"
to "remove_lease" for clarity.
- AllocEngine::reclaimExpiredLease(const Lease4Ptr& lease,
const DbReclaimMode& reclaim_mode,
const CalloutHandlePtr& callout_handle)
Simplified logic for flagging a lease for removal. Renamed "remove_tmp"
to "remove_lease" for clarity.
This change triggered a lot of code refactoring for generating the
NameChangeRequests. Long story short is that the functions responsible
for generating NCRs from the lease information have been moved to
the libdhcpsrv where they better fit and where they may be used
by both allocation engine and the servers.