From: Francis Dupont Date: Mon, 10 Dec 2018 17:40:23 +0000 (+0100) Subject: [283-perfdhcp-fix-send-due] Revamped short waits X-Git-Tag: 283-perfdhcp-sending-thread_base~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ad4f715a4b13e7d9e61b2fef1f6444e91a1429c;p=thirdparty%2Fkea.git [283-perfdhcp-fix-send-due] Revamped short waits --- diff --git a/src/bin/perfdhcp/test_control.cc b/src/bin/perfdhcp/test_control.cc index b92aee93b5..f27fc27090 100644 --- a/src/bin/perfdhcp/test_control.cc +++ b/src/bin/perfdhcp/test_control.cc @@ -1535,7 +1535,9 @@ TestControl::run() { // Calculate number of packets to be sent to stay // catch up with rate. uint64_t packets_due = basic_rate_control_.getOutboundMessageCount(); - checkLateMessages(basic_rate_control_); + if (packets_due > 0) { + checkLateMessages(basic_rate_control_); + } if ((packets_due == 0) && testDiags('i')) { if (options.getIpVersion() == 4) { stats_mgr4_->incrementCounter("shortwait"); @@ -1555,7 +1557,7 @@ TestControl::run() { break; } - if (!hasLateExitCommenced()) { + if ((packets_due > 0) && !hasLateExitCommenced()) { // Initiate new DHCP packet exchanges. sendPackets(socket, packets_due); } @@ -1565,7 +1567,9 @@ TestControl::run() { if (options.getRenewRate() != 0) { uint64_t renew_packets_due = renew_rate_control_.getOutboundMessageCount(); - checkLateMessages(renew_rate_control_); + if (renew_packets_due > 0) { + checkLateMessages(renew_rate_control_); + } // Send multiple renews to satisfy the desired rate. if (options.getIpVersion() == 4) { @@ -1580,7 +1584,9 @@ TestControl::run() { if ((options.getIpVersion() == 6) && (options.getReleaseRate() != 0)) { uint64_t release_packets_due = release_rate_control_.getOutboundMessageCount(); - checkLateMessages(release_rate_control_); + if (release_packets_due > 0) { + checkLateMessages(release_rate_control_); + } // Send Release messages. sendMultipleMessages6(socket, DHCPV6_RELEASE, release_packets_due); }