fixed a bug causing failed assertions from inconsistent counts in HostStatus
[pingcheck] / src / host / hoststatus.cpp
index e35f668..530171f 100644 (file)
@@ -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 << "): "