From 89f79cf2d216fed07de554ef01e230de7e2a5c56 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:29:19 +0100 Subject: check_icmp: set rtmin initially --- plugins-root/check_icmp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index e6a00960..dcaceddb 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -64,6 +64,7 @@ const char *email = "devel@monitoring-plugins.org"; #include #include #include +#include /** 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; } -- cgit v1.2.3-74-g34f1