diff --git a/CHANGELOG b/CHANGELOG index 98e62e693..4950934b6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,11 @@ # Nmap Changelog ($Id$); -*-text-*- +o [GH#350] Fix an assertion failure due to floating point error in equality + comparison, which triggered mainly on OpenBSD: + assertion "diff <= interval" failed: file "timing.cc", line 440 + This was reported earlier as [GH#472] but the assertion fixed there was a + different one. [David Carlier] + o [Nping][GH#559] Fix Nping's ability to use Npcap on Windows. A privilege check was performed too late, so the Npcap loading code assumed the user had no rights. [Yang Luo, Daniel Miller] diff --git a/timing.cc b/timing.cc index 1c1be23ed..60a6a4086 100644 --- a/timing.cc +++ b/timing.cc @@ -437,7 +437,7 @@ void RateMeter::update(double amount, const struct timeval *now) { interval = MAX(current_rate_history, diff); else interval = TIMEVAL_SUBTRACT(*now, start_tv) / 1000000.0; - assert(diff <= interval); + assert(diff <= interval + std::numeric_limits::epsilon()); /* If we record an amount in the very same instant that the timer is started, there's no way to calculate meaningful rates. Ignore it. */ if (interval == 0.0)