diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-11-27 15:29:19 +0100 |
---|---|---|
committer | Sven Nierlein <sven@nierlein.org> | 2024-11-28 09:02:29 +0100 |
commit | 89f79cf2d216fed07de554ef01e230de7e2a5c56 (patch) | |
tree | 88d4fc846b994c1e6aef4dd41d0b5c9a09fe453a | |
parent | 714fd1aceb22014eae64be288fa148bbbf835e33 (diff) | |
download | monitoring-plugins-89f79cf2d216fed07de554ef01e230de7e2a5c56.tar.gz |
check_icmp: set rtmin initially
-rw-r--r-- | plugins-root/check_icmp.c | 4 |
1 files changed, 3 insertions, 1 deletions
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"; | |||
64 | #include <netinet/ip_icmp.h> | 64 | #include <netinet/ip_icmp.h> |
65 | #include <netinet/icmp6.h> | 65 | #include <netinet/icmp6.h> |
66 | #include <arpa/inet.h> | 66 | #include <arpa/inet.h> |
67 | #include <math.h> | ||
67 | 68 | ||
68 | /** sometimes undefined system macros (quite a few, actually) **/ | 69 | /** sometimes undefined system macros (quite a few, actually) **/ |
69 | #ifndef MAXTTL | 70 | #ifndef MAXTTL |
@@ -1099,7 +1100,8 @@ static int wait_for_reply(int sock, u_int t) { | |||
1099 | if (tdiff > (unsigned int)host->rtmax) { | 1100 | if (tdiff > (unsigned int)host->rtmax) { |
1100 | host->rtmax = tdiff; | 1101 | host->rtmax = tdiff; |
1101 | } | 1102 | } |
1102 | if (tdiff < (unsigned int)host->rtmin) { | 1103 | |
1104 | if ((host->rtmin == INFINITY) || (tdiff < (unsigned int)host->rtmin)) { | ||
1103 | host->rtmin = tdiff; | 1105 | host->rtmin = tdiff; |
1104 | } | 1106 | } |
1105 | 1107 | ||