]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1332] elapsed now works for -Y 0
authorTomek Mrugalski <tomek@isc.org>
Wed, 18 Nov 2020 15:29:33 +0000 (16:29 +0100)
committerWlodzimierz Wencel <wlodek@isc.org>
Fri, 20 Nov 2020 09:00:16 +0000 (09:00 +0000)
src/bin/perfdhcp/test_control.cc

index 68026c4bd10dcc6d347cb90f819e4e86fea5d06a..a4cca3d85a3f0514765ea60a9de0d4f990b61df8 100644 (file)
@@ -1174,7 +1174,7 @@ TestControl::sendDiscover4(const bool preload /*= false*/) {
 
     // Check if we need to simulate HA failures by pretending no responses were received.
     // The DHCP protocol signals that by increasing secs field (seconds since the configuration attempt started).
-    if (options_.getWaitForElapsedTime() &&
+    if (options_.getIncreaseElapsedTime() &&
         stats_mgr_.getTestPeriod().length().total_seconds() >= options_.getWaitForElapsedTime() &&
         stats_mgr_.getTestPeriod().length().total_seconds() < options_.getWaitForElapsedTime() +
                                      options_.getIncreaseElapsedTime()) {
@@ -1648,11 +1648,12 @@ TestControl::sendSolicit6(const bool preload /*= false*/) {
 
     // Check if we need to simulate HA failures by pretending no responses were received.
     // The DHCPv6 protocol signals that by increasing the elapsed option field. Note it is in 1/100 of a second.
-    if (options_.getWaitForElapsedTime() &&
+    if (options_.getIncreaseElapsedTime() &&
         stats_mgr_.getTestPeriod().length().total_seconds() >= options_.getWaitForElapsedTime() &&
         stats_mgr_.getTestPeriod().length().total_seconds() < options_.getWaitForElapsedTime() +
                                      options_.getIncreaseElapsedTime()) {
 
+
         // Keep increasing elapsed time. The value should start increasing steadily.
         uint32_t val = (stats_mgr_.getTestPeriod().length().total_seconds() - options_.getWaitForElapsedTime() + 1)*100;
         if (val > 65535) {