git: 635cd36c1ba7 - main - net-mgmt/nagios-plugins: fix TTL on outgoing packets for IPv6

From: Dirk Meyer <dinoex_at_FreeBSD.org>
Date: Sat, 24 Jan 2026 06:18:33 UTC
The branch main has been updated by dinoex:

URL: https://cgit.FreeBSD.org/ports/commit/?id=635cd36c1ba7dcd73c893683dc11518f5fa27746

commit 635cd36c1ba7dcd73c893683dc11518f5fa27746
Author:     Dirk Meyer <dinoex@FreeBSD.org>
AuthorDate: 2026-01-24 06:18:09 +0000
Commit:     Dirk Meyer <dinoex@FreeBSD.org>
CommitDate: 2026-01-24 06:18:09 +0000

    net-mgmt/nagios-plugins: fix TTL on outgoing packets for IPv6
---
 net-mgmt/nagios-plugins/Makefile                         |  1 +
 .../nagios-plugins/files/patch-plugins-root_check_icmp.c | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/net-mgmt/nagios-plugins/Makefile b/net-mgmt/nagios-plugins/Makefile
index 3715457142bf..2fb7bbc3e087 100644
--- a/net-mgmt/nagios-plugins/Makefile
+++ b/net-mgmt/nagios-plugins/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	nagios-plugins
 DISTVERSION=	2.4.4
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	https://github.com/${PORTNAME}/${PORTNAME}/releases/download/release-${DISTVERSION}/ \
diff --git a/net-mgmt/nagios-plugins/files/patch-plugins-root_check_icmp.c b/net-mgmt/nagios-plugins/files/patch-plugins-root_check_icmp.c
new file mode 100644
index 000000000000..bfefdabb0f62
--- /dev/null
+++ b/net-mgmt/nagios-plugins/files/patch-plugins-root_check_icmp.c
@@ -0,0 +1,16 @@
+--- plugins-root/check_icmp.c.orig	2021-02-16 13:28:19 UTC
++++ plugins-root/check_icmp.c
+@@ -785,7 +785,12 @@ int main(int argc, char **argv) {
+   }
+ 
+   if (icmp_sock) {
+-    result = setsockopt(icmp_sock, SOL_IP, IP_TTL, &ttl, sizeof(ttl));
++    if (address_family == AF_INET) {
++      result = setsockopt(icmp_sock, SOL_IP, IP_TTL, &ttl, sizeof(ttl));
++    } else if (address_family == AF_INET6) {
++      int hoplimit = ttl;
++      result = setsockopt(icmp_sock, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &hoplimit, sizeof(hoplimit));
++    }
+     if (debug) {
+       if (result == -1) {
+         printf("setsockopt failed\n");