From db625177cbfdfa0bfb0219ccd50a4b1383c65390 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Thu, 21 May 2015 09:39:15 +0200 Subject: [PATCH] fixed a bug causing failed assertions from inconsistent counts in HostStatus reason was that number of IPs may change if target host is a cname that has changed to a different end host; this is very hard to predict so always reset counters if number of IPs changes --- src/host/hoststatus.cpp | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/host/hoststatus.cpp b/src/host/hoststatus.cpp index e35f668..530171f 100644 --- a/src/host/hoststatus.cpp +++ b/src/host/hoststatus.cpp @@ -65,6 +65,10 @@ void HostStatus::set_resolved_ip_count( const int resolved_ip_count ) { BOOST_ASSERT( 1 <= resolved_ip_count ); + if (resolved_ip_count != ResolvedIpCount) + { // assume that the target has changed --> reset counters + reset_ping_counters(); + } ResolvedIpCount = resolved_ip_count; GlobalLogger.notice() << "Stat(" << HostAddress << "): " -- 1.7.1