completed partial IPv6 compatibility in DNS; does retrieve and Cache IPv6 IPs
[pingcheck] / src / host / pingscheduler.cpp
index 179a70b..481d394 100644 (file)
@@ -318,6 +318,12 @@ void PingScheduler::update_ping_protocol()
 
 void PingScheduler::get_next_ping_protocol()
 {
+    if (Ping)
+    {
+        Ping->stop_pinging();
+        Ping.reset();
+    }
+
     GlobalLogger.debug() << LogPrefix
         << "------------------------------------------------------------------";
     ++ProtocolIter;
@@ -327,9 +333,6 @@ void PingScheduler::get_next_ping_protocol()
     // --> ProtocolIter still points to currently used protocol which is
     //     required in dns_resolve_callback
 
-    if (Ping)
-        Ping->stop_pinging();
-
     Ping = PingerFactory::createPinger(ping_protocol, IoService,
                                        NetworkInterfaceName, PingReplyTimeout);