E}/net-${PORTNAME}/${PORTVERSION} \ @@ -145,8 +144,8 @@ CONFIGURE_ARGS+=--enable-agentx-dom-sock-only CONFIGURE_ARGS+=--without-root-access .endif -SHLIB_VERSION= 40 -SHLIB_VERSION2= .2.1 +SHLIB_VERSION= 45 +SHLIB_VERSION2= .0.0 PLIST_SUB+= SHLIB_VERSION=${SHLIB_VERSION} SHLIB_VERSION2=${SHLIB_VERSION2} SCRIPTS_SUB= PREFIX=${PREFIX} PERL=${PERL} diff --git a/net-mgmt/net-snmp/distinfo b/net-mgmt/net-snmp/distinfo index 8493e064aaa9..824cbe9fe384 100644 --- a/net-mgmt/net-snmp/distinfo +++ b/net-mgmt/net-snmp/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1709374659 -SHA256 (net-snmp-5.9.4.tar.gz) = 8b4de01391e74e3c7014beb43961a2d6d6fa03acc34280b9585f4930745b0544 -SIZE (net-snmp-5.9.4.tar.gz) = 6681606 +TIMESTAMP = 1767710816 +SHA256 (net-snmp-5.9.5.2.tar.gz) = 16707719f833184a4b72835dac359ae188123b06b5e42817c00790d7dc1384bf +SIZE (net-snmp-5.9.5.2.tar.gz) = 6826866 diff --git a/net-mgmt/net-snmp/files/patch-agent_kernel.c b/net-mgmt/net-snmp/files/patch-agent_kernel.c deleted file mode 100644 index 133b04bd1824..000000000000 --- a/net-mgmt/net-snmp/files/patch-agent_kernel.c +++ /dev/null @@ -1,40 +0,0 @@ ---- agent/kernel.c.orig 2023-08-15 20:32:01 UTC -+++ agent/kernel.c -@@ -252,7 +252,37 @@ free_kmem(void) - kmem = -1; - } - } -+#elif defined(__FreeBSD__) -+kvm_t *kd; - -+/** -+ * Initialize the libkvm descriptor. On FreeBSD we can use most of libkvm -+ * without requiring /dev/kmem access. Only kvm_nlist() and kvm_read() need -+ * that, and we don't use them. -+ * -+ * @return TRUE upon success; FALSE upon failure. -+ */ -+int -+init_kmem(const char *file) -+{ -+ char err[4096]; -+ -+ kd = kvm_openfiles(NULL, "/dev/null", NULL, O_RDONLY, err); -+ if (!kd) { -+ snmp_log(LOG_CRIT, "init_kmem: kvm_openfiles failed: %s\n", err); -+ return FALSE; -+ } -+ return TRUE; -+} -+ -+void -+free_kmem(void) -+{ -+ if (kd != NULL) { -+ (void)kvm_close(kd); -+ kd = NULL; -+ } -+} - #else - int - init_kmem(const char *file) diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_ipv6.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_ipv6.c deleted file mode 100644 index ad4ea51fe56a..000000000000 --- a/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_ipv6.c +++ /dev/null @@ -1,127 +0,0 @@ ---- agent/mibgroup/mibII/ipv6.c.orig 2023-08-15 20:32:01 UTC -+++ agent/mibgroup/mibII/ipv6.c -@@ -5,9 +5,6 @@ - - #include - #include --/* For FreeBSD */ --#define _WANT_INPCB 1 --#define _WANT_TCPCB 1 - #include - #include - #ifdef HAVE_SYS_IOCTL_H -@@ -1513,8 +1510,10 @@ var_udp6(register struct variable * vp, - int result; - int i, j; - caddr_t p; --#if defined(openbsd4) || defined(freebsd3) -+#if defined(openbsd4) - static struct inpcb in6pcb, savpcb; -+#elif defined(freebsd3) -+ static struct xinpcb in6pcb, savpcb; - #else - static struct in6pcb in6pcb, savpcb; - #endif -@@ -1614,8 +1613,7 @@ var_udp6(register struct variable * vp, - DEBUGMSGTL(("mibII/ipv6", "looping: p=%p\n", p)); - - #if defined(freebsd3) -- /* To do: fill in in6pcb properly. */ -- memset(&in6pcb, 0, sizeof(in6pcb)); -+ in6pcb = *(struct xinpcb *) xig; - #elif defined(darwin) - in6pcb = ((struct xinpcb *) xig)->xi_inp; - #else -@@ -2108,12 +2106,18 @@ var_tcp6(register struct variable * vp, - int result; - int i, j; - caddr_t p; --#if defined(openbsd4) || defined(freebsd3) -+#if defined(openbsd4) - static struct inpcb in6pcb, savpcb; -+#elif defined(freebsd3) -+ static struct xinpcb in6pcb; -+ static int savstate; - #else - static struct in6pcb in6pcb, savpcb; - #endif -+#if !defined(freebsd3) - struct tcpcb tcpcb; -+#endif -+ int state; - int found, savnameLen; - #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 || defined(openbsd4) /*1.6Y*/ - struct inpcbtable tcbtable; -@@ -2208,8 +2212,7 @@ var_tcp6(register struct variable * vp, - DEBUGMSGTL(("mibII/ipv6", "looping: p=%p\n", p)); - - #if defined(freebsd3) -- /* To do: fill in in6pcb properly. */ -- memset(&in6pcb, 0, sizeof(in6pcb)); -+ in6pcb = ((struct xtcpcb *) xig)->xt_inp; - #elif defined(dragonfly) - in6pcb = xtp->xt_inp; - #elif defined(darwin) -@@ -2294,7 +2297,11 @@ var_tcp6(register struct variable * vp, - #endif - result = snmp_oid_compare(name, *length, newname, j); - if (exact && (result == 0)) { -+#if defined(freebsd3) -+ savstate = ((struct xtcpcb *) xig)->t_state; -+#else - memcpy(&savpcb, &in6pcb, sizeof(savpcb)); -+#endif - savnameLen = j; - memcpy(savname, newname, j * sizeof(oid)); - found++; -@@ -2305,7 +2312,11 @@ var_tcp6(register struct variable * vp, - */ - if ((savnameLen == 0) || - (snmp_oid_compare(savname, savnameLen, newname, j) > 0)) { -+#if defined(freebsd3) -+ savstate = ((struct xtcpcb *) xig)->t_state; -+#else - memcpy(&savpcb, &in6pcb, sizeof(savpcb)); -+#endif - savnameLen = j; - memcpy(savname, newname, j * sizeof(oid)); - found++; -@@ -2344,19 +2355,27 @@ var_tcp6(register struct variable * vp, - return NULL; - *length = savnameLen; - memcpy((char *) name, (char *) savname, *length * sizeof(oid)); -+#if defined(freebsd3) -+ state = savstate; -+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 999010400 - memcpy(&in6pcb, &savpcb, sizeof(savpcb)); --#if defined(__NetBSD__) && __NetBSD_Version__ >= 999010400 - if (!NETSNMP_KLOOKUP(in6pcb.in6p_pcb.inp_ppcb, (char *) &tcpcb, sizeof(tcpcb))) { - DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %p\n", - in6pcb.in6p_pcb.inp_ppcb)); -+ found = 0; -+ return NULL; -+ } -+ state = (int)tcpcb.t_state; - #else -+ memcpy(&in6pcb, &savpcb, sizeof(savpcb)); - if (!NETSNMP_KLOOKUP(in6pcb.inp_ppcb, (char *) &tcpcb, sizeof(tcpcb))) { - DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %p\n", - in6pcb.inp_ppcb)); --#endif - found = 0; - return NULL; - } -+ state = (int)tcpcb.t_state; -+#endif - *write_method = 0; - *var_len = sizeof(long); /* default to 'long' results */ - -@@ -2368,7 +2387,7 @@ var_tcp6(register struct variable * vp, - DEBUGMSGTL(("mibII/ipv6", "magic=%d\n", vp->magic)); - switch (vp->magic) { - case IPV6TCPCONNSTATE: -- long_return = mapTcpState((int)tcpcb.t_state); -+ long_return = mapTcpState(state); - return (u_char *) & long_return; - default: - break; diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_tcp.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_tcp.c deleted file mode 100644 index 83470a30dedf..000000000000 --- a/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_tcp.c +++ /dev/null @@ -1,35 +0,0 @@ ---- agent/mibgroup/mibII/tcp.c.orig 2023-08-15 13:32:01.000000000 -0700 -+++ agent/mibgroup/mibII/tcp.c 2025-07-10 17:17:00.309421000 -0700 -@@ -8,6 +8,14 @@ - #include - #include "mibII_common.h" - -+#include -+ -+#if defined(__FreeBSD_version) && __FreeBSD_version > 1400066 -+#define IPFRAGTTL 60 /* time to live for frags, slowhz */ -+#define PR_SLOWHZ 2 /* 2 slow timeouts per second */ -+#define PR_FASTHZ 5 /* 5 fast timeouts per second */ -+#endif -+ - #ifdef HAVE_STDLIB_H - #include - #endif -@@ -38,8 +46,17 @@ - #include - #endif - #ifdef HAVE_NETINET_TCP_TIMER_H -+#if __FreeBSD_version >= 1500048 -+#define _KERNEL -+#define max(x, y) (((x) > (y)) ? (x) : (y)) -+#define MSEC_2_TICKS(m) max(1, (uint32_t)((hz == 1000) ? \ -+ (m) : ((uint64_t)(m) * (uint64_t)hz)/(uint64_t)1000)) -+#endif - #include -+#if __FreeBSD_version >= 1500048 -+#undef _KERNEL - #endif -+#endif - #ifdef HAVE_NETINET_TCP_VAR_H - #ifdef openbsd7 - #define _KERNEL /* OpenBSD 7.3 */ diff --git a/net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd16.h b/net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd16.h deleted file mode 100644 index fff6187daf87..000000000000 --- a/net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd16.h +++ /dev/null @@ -1,6 +0,0 @@ ---- /dev/null 2025-09-10 01:07:21.909920000 +0200 -+++ include/net-snmp/system/freebsd16.h 2025-09-10 01:07:12.250409000 +0200 -@@ -0,0 +1,3 @@ -+/* freebsd16 is a superset of freebsd15 for now */ -+#include "freebsd15.h" -+#define freebsd15 freebsd15 diff --git a/net-mgmt/net-snmp/pkg-plist b/net-mgmt/net-snmp/pkg-plist index 9102b2376cbb..16bae42a5636 100644 --- a/net-mgmt/net-snmp/pkg-plist +++ b/net-mgmt/net-snmp/pkg-plist @@ -211,6 +211,8 @@ include/net-snmp/system/openbsd.h include/net-snmp/system/openbsd4.h include/net-snmp/system/openbsd5.h include/net-snmp/system/openbsd6.h +include/net-snmp/system/openbsd7.h +include/net-snmp/system/openbsd8.h include/net-snmp/system/osf5.h include/net-snmp/system/solaris.h include/net-snmp/system/solaris2.3.h