check_icmp: set rtmin initially

This commit is contained in:
Lorenz Kästle 2024-11-27 15:29:19 +01:00 committed by Sven Nierlein
parent 714fd1aceb
commit 89f79cf2d2

View file

@ -64,6 +64,7 @@ const char *email = "devel@monitoring-plugins.org";
#include <netinet/ip_icmp.h>
#include <netinet/icmp6.h>
#include <arpa/inet.h>
#include <math.h>
/** sometimes undefined system macros (quite a few, actually) **/
#ifndef MAXTTL
@ -1099,7 +1100,8 @@ static int wait_for_reply(int sock, u_int t) {
if (tdiff > (unsigned int)host->rtmax) {
host->rtmax = tdiff;
}
if (tdiff < (unsigned int)host->rtmin) {
if ((host->rtmin == INFINITY) || (tdiff < (unsigned int)host->rtmin)) {
host->rtmin = tdiff;
}