I have an icinga-instance running on openbsd.amsterdam. Here I found
that sometimes check_ping from the monitoring-plugins package fails,
because ping(8) sends "failed to get receiving hop limit", but still
receives all the ping replies. These packets/annomalies are clearly
not meant for us.
Since this check is done before the ICMP6_ECHO_REPLY check and our
manpage states:
-v Verbose output. ICMP packets other than ECHO_REPLY that are
received are listed.
I think the following diff is warranted and solves my false warning
states.
OK?
martijn@
Index: ping.c
===================================================================
RCS file: /cvs/src/sbin/ping/ping.c,v
retrieving revision 1.240
diff -u -p -r1.240 ping.c
--- ping.c 11 Feb 2020 18:41:39 -0000 1.240
+++ ping.c 20 Oct 2020 07:19:49 -0000
@@ -1180,7 +1180,8 @@ pr_pack(u_char *buf, int cc, struct msgh
icp6 = (struct icmp6_hdr *)buf;
if ((hoplim = get_hoplim(mhdr)) == -1) {
- warnx("failed to get receiving hop limit");
+ if (options & F_VERBOSE)
+ warnx("failed to get receiving hop limit");
return;
}