From: Marcin Siodelski Date: Wed, 30 Sep 2015 08:57:43 +0000 (+0200) Subject: [3972] Addressed review comments - minor nits. X-Git-Tag: trac4074_base~9^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=92f52e2c03faec1883014b77267aecf7230fb3d8;p=thirdparty%2Fkea.git [3972] Addressed review comments - minor nits. --- diff --git a/src/bin/dhcp4/dhcp4_hooks.dox b/src/bin/dhcp4/dhcp4_hooks.dox index 82ca15cd19..4ae78aece5 100644 --- a/src/bin/dhcp4/dhcp4_hooks.dox +++ b/src/bin/dhcp4/dhcp4_hooks.dox @@ -231,9 +231,11 @@ packet processing. Hook points that are not specific to packet processing argument contains the pointer to the lease being reclaimed. The second argument "remove_lease" indicates if the reclaimed leases should be removed from the lease database (if true), or their state should be - set to "expired-reclaimed" in the lease database. This parameter + set to "expired-reclaimed" in the lease database. This argument is only used by the callout if it takes responsibility for the lease - reclamation, i.e. it sets the "skip" flag to "true". + reclamation, i.e. it sets the "skip" flag to "true". The "remove_lease" + argument is set to "true" if the "recycle-timer-wait-time" is set + to 0 in the server configuration file. - Skip flag action: if the callout sets the skip flag, the server will assume that the callout has fully reclaimed the lease, i.e. diff --git a/src/bin/dhcp6/dhcp6_hooks.dox b/src/bin/dhcp6/dhcp6_hooks.dox index 8a6cb1e4a5..0ea8deb007 100644 --- a/src/bin/dhcp6/dhcp6_hooks.dox +++ b/src/bin/dhcp6/dhcp6_hooks.dox @@ -249,9 +249,11 @@ packet processing. Hook points that are not specific to packet processing argument contains the pointer to the lease being reclaimed. The second argument "remove_lease" indicates if the reclaimed leases should be removed from the lease database (if true), or their state should be - set to "expired-reclaimed" in the lease database. This parameter + set to "expired-reclaimed" in the lease database. This argument is only used by the callout if it takes responsibility for the lease - reclamation, i.e. it sets the "skip" flag to "true". + reclamation, i.e. it sets the "skip" flag to "true". The "remove_lease" + argument is set to "true" if the "recycle-timer-wait-time" is set + to 0 in the server configuration file. - Skip flag action: if the callout sets the skip flag, the server will assume that the callout has fully reclaimed the lease, i.e. diff --git a/src/lib/dhcpsrv/alloc_engine.cc b/src/lib/dhcpsrv/alloc_engine.cc index 5dcdf19724..ce00a22693 100644 --- a/src/lib/dhcpsrv/alloc_engine.cc +++ b/src/lib/dhcpsrv/alloc_engine.cc @@ -1424,7 +1424,7 @@ AllocEngine::reclaimExpiredLeases4(const size_t max_leases, const uint16_t timeo lease_mgr.getExpiredLeases4(leases, max_leases); // Do not initialize the callout handle until we know if there are any - // lease6_expire callouts installed. + // lease4_expire callouts installed. CalloutHandlePtr callout_handle; if (!leases.empty() && HooksManager::getHooksManager().calloutsPresent(Hooks.hook_index_lease4_expire_)) { diff --git a/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc b/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc index decc6847f9..2210fb791e 100644 --- a/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc +++ b/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc @@ -1159,8 +1159,7 @@ TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesHooksWithSkip) { // This test verifies that it is possible to set the timeout for the // execution of the lease reclamation routine. TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesTimeout) { - // For this test to make sense we need significantly more than 30 - // leases so it is ok if we have 40. + // This test needs at least 40 leases to make sense. BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 40); // Run with timeout of 60ms. testReclaimExpiredLeasesTimeout(60); @@ -1524,8 +1523,7 @@ TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesHooksWithSkip) { // This test verifies that it is possible to set the timeout for the // execution of the lease reclamation routine. TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesTimeout) { - // For this test to make sense we need significantly more than 30 - // leases so it is ok if we have 40. + // This test needs at least 40 leases to make sense. BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 40); // Run with timeout of 60ms. testReclaimExpiredLeasesTimeout(60);