Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2019 21:45:47 +0000 (UTC)
From:      Kurt Jaeger <pi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r513422 - in head/net-mgmt/net-snmp: . files
Message-ID:  <201909302145.x8ULjlkF026018@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pi
Date: Mon Sep 30 21:45:46 2019
New Revision: 513422
URL: https://svnweb.freebsd.org/changeset/ports/513422

Log:
  net-mgmt/net-snmp: revert back to 5.7.3 due to side-effects
  
  PR:		232025
  Submitted by:	dvl
  Reviewed by:	zi, otis@sk.FreeBSD.org

Added:
  head/net-mgmt/net-snmp/files/extra-patch-openssl11
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/extra-patch-openssl11
  head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu_sysctl.c
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu_sysctl.c
  head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_fsys_fsys__getfsstats.c
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_fsys_fsys__getfsstats.c
  head/net-mgmt/net-snmp/files/patch-agent_mibgroup_ucd-snmp_diskio.c
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/patch-agent_mibgroup_ucd-snmp_diskio.c
  head/net-mgmt/net-snmp/files/patch-include__net-snmp__net-snmp-config.h.in
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/patch-include__net-snmp__net-snmp-config.h.in
  head/net-mgmt/net-snmp/files/patch-kthreads
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/patch-kthreads
  head/net-mgmt/net-snmp/files/patch-perl5.23
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/patch-perl5.23
  head/net-mgmt/net-snmp/files/patch-snmplib_snmp__api.c
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/patch-snmplib_snmp__api.c
  head/net-mgmt/net-snmp/files/patch-snmpusm.c
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/patch-snmpusm.c
  head/net-mgmt/net-snmp/files/patch-tcpTable.c
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/patch-tcpTable.c
  head/net-mgmt/net-snmp/files/patch-transform_oids.h
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/patch-transform_oids.h
  head/net-mgmt/net-snmp/files/patch-udpTable.c
     - copied unchanged from r513139, head/net-mgmt/net-snmp/files/patch-udpTable.c
Deleted:
  head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c
  head/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_tcpTable.c
  head/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_udpTable.c
  head/net-mgmt/net-snmp/files/patch-include_net-snmp_library_transform__oids.h
  head/net-mgmt/net-snmp/files/patch-snmplib_snmpusm.c
Modified:
  head/net-mgmt/net-snmp/Makefile
  head/net-mgmt/net-snmp/distinfo
  head/net-mgmt/net-snmp/files/extra-patch-local_Makefile.in
  head/net-mgmt/net-snmp/files/patch-Makefile.in   (contents, props changed)
  head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_memory_memory__freebsd.c
  head/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_icmp.h
  head/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c
  head/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c
  head/net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd13.h
  head/net-mgmt/net-snmp/pkg-plist

Modified: head/net-mgmt/net-snmp/Makefile
==============================================================================
--- head/net-mgmt/net-snmp/Makefile	Mon Sep 30 21:34:22 2019	(r513421)
+++ head/net-mgmt/net-snmp/Makefile	Mon Sep 30 21:45:46 2019	(r513422)
@@ -2,7 +2,9 @@
 # $FreeBSD$
 
 PORTNAME=	snmp
-PORTVERSION=	5.8
+PORTVERSION=	5.7.3
+PORTREVISION=	20
+PORTEPOCH=	1
 CATEGORIES=	net-mgmt ipv6
 MASTER_SITES=	SF/net-${PORTNAME}/net-${PORTNAME}/${PORTVERSION} \
 		ZI
@@ -18,19 +20,7 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 NOT_FOR_ARCHS=		mips mips64
 NOT_FOR_ARCHS_REASON=	SSP is currently broken on MIPS
 
-LIB_DEPENDS=	libpkg.so:ports-mgmt/pkg \
-		libpcre.so:devel/pcre
-
-USES=		cpe libtool perl5 ssl
-USE_RC_SUBR=	snmpd snmptrapd
-USE_LDCONFIG=	yes
-USE_PERL5=	build run
-USE_CSTD=	c99
-
-CPE_VENDOR=	net-snmp
-GNU_CONFIGURE=	yes
-
-OPTIONS_DEFINE=	MFD_REWRITES PERL PERL_EMBEDDED PYTHON DUMMY TKMIB \
+OPTIONS_DEFINE=	IPV6 MFD_REWRITES PERL PERL_EMBEDDED PYTHON DUMMY TKMIB \
 		MYSQL AX_SOCKONLY UNPRIVILEGED SMUX DOCS JAIL AX_DISABLE_TRAP \
 		TLS NEWSYSLOG
 OPTIONS_DEFAULT=PERL PERL_EMBEDDED DUMMY SMUX NEWSYSLOG
@@ -51,6 +41,14 @@ MAKE_JOBS_UNSAFE=	yes
 
 PORTSCOUT=	skipv:5.7.2.1
 
+GNU_CONFIGURE=	yes
+USE_RC_SUBR=	snmpd snmptrapd
+USE_LDCONFIG=	yes
+USES=		cpe libtool perl5 ssl
+CPE_VENDOR=	net-snmp
+USE_PERL5=	build run
+USE_CSTD=	c99
+
 CFLAGS+=	-I${LOCALBASE}/include -I${PKG_PREFIX}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
 CONFIGURE_ENV+=	PERLPROG="${PERL}" PSPROG="${PS_CMD}" SED="${SED}"
@@ -76,6 +74,10 @@ TLS_CONFIGURE_ON=	--with-security-modules=tsm --with-t
 
 .include <bsd.port.options.mk>
 
+.if (${OSVERSION} >= 1200085 || ${SSL_DEFAULT:Mopenssl111*})
+EXTRA_PATCHES=	${PATCHDIR}/extra-patch-openssl11
+.endif
+
 .if ${PORT_OPTIONS:MPYTHON}
 PYDISTUTILS_PKGNAME?=		netsnmp-python
 PYDISTUTILS_PKGVERSION?=	1.0a1
@@ -136,12 +138,20 @@ CONFIGURE_ARGS+=--disable-snmptrapd-subagent
 CONFIGURE_ARGS+=--enable-agentx-dom-sock-only
 .endif
 
+.if ${PORT_OPTIONS:MIPV6}
+CONFIGURE_ARGS+=--enable-ipv6
+# --with-transport="UDPIPv6 TCPIPv6" --with-modules=mibII/ipv6"
+PLIST_SUB+=	WITH_IPV6=""
+.else
+PLIST_SUB+=	WITH_IPV6="@comment "
+.endif
+
 .if ${PORT_OPTIONS:MUNPRIVILEGED}
 CONFIGURE_ARGS+=--without-root-access
 .endif
 
-SHLIB_VERSION=	35
-SHLIB_VERSION2=	.0.0
+SHLIB_VERSION=	30
+SHLIB_VERSION2=	.0.3
 PLIST_SUB+=	SHLIB_VERSION=${SHLIB_VERSION} SHLIB_VERSION2=${SHLIB_VERSION2}
 SCRIPTS_SUB=	PREFIX=${PREFIX} PERL=${PERL}
 
@@ -186,12 +196,7 @@ CONFIGURE_ARGS+=--with-out-mib-modules="${NET_SNMP_WIT
 BIN_FILES=	snmpbulkwalk snmpget snmpgetnext snmpset \
 		snmpstatus snmptest snmptranslate snmptrap snmpwalk \
 		snmptable snmpbulkget snmpdelta snmpdf agentxtrap \
-		snmpvacm snmpusm encode_keychange snmpnetstat \
-		snmppcap snmpping snmpps
-.if ${PORT_OPTIONS:MTLS}
-BIN_FILES+=	snmptls
-.endif
-
+		snmpvacm snmpusm encode_keychange snmpnetstat
 LIB_FILES=	libnetsnmp.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
 		libnetsnmpagent.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
 		libnetsnmpmibs.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
@@ -238,13 +243,17 @@ pre-everything::
 
 post-patch:
 .for filename in ${SCRIPT_FILES}
-	${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/local/${filename}
+	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/local/${filename}
 .endfor
-	${REINPLACE_CMD} -e 's!utmp_p->ut_name!utmp_p->ut_user!' \
+	@${REINPLACE_CMD} -e 's!utmp_p->ut_name!utmp_p->ut_user!' \
 	    ${WRKSRC}/agent/mibgroup/host/hr_system.c
-	${REINPLACE_CMD} -E -e 's|return pci_lookup_name|disabled broken|g' \
+	@${REINPLACE_CMD} -E -e 's|return pci_lookup_name|disabled broken|g' \
 		${WRKSRC}/configure
-	${CP} ${WRKSRC}/include/net-snmp/system/freebsd12.h \
+.if (${OSVERSION} >= 1200085 || ${SSL_DEFAULT:Mopenssl111*})
+	@${REINPLACE_CMD} -E -e 's|SSL_library_init|OPENSSL_init_ssl|g' \
+		${WRKSRC}/configure
+.endif
+	@${CP} ${WRKSRC}/include/net-snmp/system/freebsd12.h \
 		${WRKSRC}/include/net-snmp/system/freebsd13.h
 
 post-configure:
@@ -298,7 +307,7 @@ install-config-files:
 
 install-doc-files:
 .if ${PORT_OPTIONS:MDOCS}
-	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 . for filename in ${DOC_FILES}
 	${INSTALL_DATA} ${WRKSRC}/${filename} ${STAGEDIR}${DOCSDIR}
 . endfor

Modified: head/net-mgmt/net-snmp/distinfo
==============================================================================
--- head/net-mgmt/net-snmp/distinfo	Mon Sep 30 21:34:22 2019	(r513421)
+++ head/net-mgmt/net-snmp/distinfo	Mon Sep 30 21:45:46 2019	(r513422)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1538855962
-SHA256 (net-snmp-5.8.tar.gz) = b2fc3500840ebe532734c4786b0da4ef0a5f67e51ef4c86b3345d697e4976adf
-SIZE (net-snmp-5.8.tar.gz) = 6591680
+TIMESTAMP = 1538855961
+SHA256 (net-snmp-5.7.3.tar.gz) = 12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0
+SIZE (net-snmp-5.7.3.tar.gz) = 6382428

Modified: head/net-mgmt/net-snmp/files/extra-patch-local_Makefile.in
==============================================================================
--- head/net-mgmt/net-snmp/files/extra-patch-local_Makefile.in	Mon Sep 30 21:34:22 2019	(r513421)
+++ head/net-mgmt/net-snmp/files/extra-patch-local_Makefile.in	Mon Sep 30 21:45:46 2019	(r513422)
@@ -1,11 +1,11 @@
---- local/Makefile.in.orig	2018-07-16 14:33:40 UTC
+--- local/Makefile.in.orig	2015-01-19 14:37:56 UTC
 +++ local/Makefile.in
-@@ -14,7 +14,7 @@ OTHERUNINSTALL=localuninstall
+@@ -16,7 +16,7 @@ OTHERUNINSTALL=localuninstall
  #
  SNMPCONFPATH=@SNMPCONFPATH@
  PERSISTENT_DIRECTORY=@PERSISTENT_DIRECTORY@
--PERLSCRIPTS=snmpcheck tkmib mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert checkbandwidth
-+PERLSCRIPTS=snmpcheck mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert checkbandwidth
+-PERLSCRIPTS=snmpcheck tkmib mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert
++PERLSCRIPTS=snmpcheck mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert
  SHELLSCRIPTS=mib2c-update
  SCRIPTSMADEFORPERL=snmpcheck.made tkmib.made mib2c.made fixproc.made \
  	ipf-mod.pl.made snmpconf.made traptoemail.made snmp-bridge-mib.made \

Copied: head/net-mgmt/net-snmp/files/extra-patch-openssl11 (from r513139, head/net-mgmt/net-snmp/files/extra-patch-openssl11)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/net-snmp/files/extra-patch-openssl11	Mon Sep 30 21:45:46 2019	(r513422, copy of r513139, head/net-mgmt/net-snmp/files/extra-patch-openssl11)
@@ -0,0 +1,223 @@
+--- apps/snmpusm.c
++++ apps/snmpusm.c
+@@ -125,6 +125,32 @@ char           *usmUserPublic_val = NULL
+ int             docreateandwait = 0;
+ 
+ 
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++
++#include <string.h>
++#include <openssl/engine.h>
++
++void DH_get0_pqg(const DH *dh,
++                const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
++{
++   if (p != NULL)
++       *p = dh->p;
++   if (q != NULL)
++       *q = dh->q;
++   if (g != NULL)
++       *g = dh->g;
++}
++
++void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)
++{
++   if (pub_key != NULL)
++       *pub_key = dh->pub_key;
++   if (priv_key != NULL)
++       *priv_key = dh->priv_key;
++}
++
++#endif
++
+ void
+ usage(void)
+ {
+@@ -190,7 +216,7 @@ get_USM_DH_key(netsnmp_variable_list *va
+                oid *keyoid, size_t keyoid_len) {
+     u_char *dhkeychange;
+     DH *dh;
+-    BIGNUM *other_pub;
++    BIGNUM *p, *g, *pub_key, *other_pub;
+     u_char *key;
+     size_t key_len;
+             
+@@ -205,25 +231,29 @@ get_USM_DH_key(netsnmp_variable_list *va
+         dh = d2i_DHparams(NULL, &cp, dhvar->val_len);
+     }
+ 
+-    if (!dh || !dh->g || !dh->p) {
++    if (dh)
++        DH_get0_pqg(dh, &p, NULL, &g);
++
++    if (!dh || !g || !p) {
+         SNMP_FREE(dhkeychange);
+         return SNMPERR_GENERR;
+     }
+ 
+-    DH_generate_key(dh);
+-    if (!dh->pub_key) {
++    if (!DH_generate_key(dh)) {
+         SNMP_FREE(dhkeychange);
+         return SNMPERR_GENERR;
+     }
+             
+-    if (vars->val_len != (unsigned int)BN_num_bytes(dh->pub_key)) {
++    DH_get0_key(dh, &pub_key, NULL);
++
++    if (vars->val_len != (unsigned int)BN_num_bytes(pub_key)) {
+         SNMP_FREE(dhkeychange);
+         fprintf(stderr,"incorrect diffie-helman lengths (%lu != %d)\n",
+-                (unsigned long)vars->val_len, BN_num_bytes(dh->pub_key));
++                (unsigned long)vars->val_len, BN_num_bytes(pub_key));
+         return SNMPERR_GENERR;
+     }
+ 
+-    BN_bn2bin(dh->pub_key, dhkeychange + vars->val_len);
++    BN_bn2bin(pub_key, dhkeychange + vars->val_len);
+ 
+     key_len = DH_size(dh);
+     if (!key_len) {
+--- configure.d/config_os_libs2
++++ configure.d/config_os_libs2
+@@ -291,12 +291,6 @@ if test "x$tryopenssl" != "xno" -a "x$tr
+             AC_CHECK_LIB(${CRYPTO}, AES_cfb128_encrypt, 
+                 AC_DEFINE(HAVE_AES_CFB128_ENCRYPT, 1,
+                     [Define to 1 if you have the `AES_cfb128_encrypt' function.]))
+-
+-            AC_CHECK_LIB(${CRYPTO}, EVP_MD_CTX_create,
+-                AC_DEFINE([HAVE_EVP_MD_CTX_CREATE], [],
+-                    [Define to 1 if you have the `EVP_MD_CTX_create' function.])
+-                AC_DEFINE([HAVE_EVP_MD_CTX_DESTROY], [],
+-                    [Define to 1 if you have the `EVP_MD_CTX_destroy' function.]))
+         fi
+         if echo " $transport_result_list " | $GREP "DTLS" > /dev/null; then
+ 	    AC_CHECK_LIB(ssl, DTLSv1_method,
+--- snmplib/keytools.c
++++ snmplib/keytools.c
+@@ -149,13 +149,13 @@ generate_Ku(const oid * hashtype, u_int
+      */
+ #ifdef NETSNMP_USE_OPENSSL
+ 
+-#ifdef HAVE_EVP_MD_CTX_CREATE
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
+     ctx = EVP_MD_CTX_create();
+ #else
+-    ctx = malloc(sizeof(*ctx));
+-    if (!EVP_MD_CTX_init(ctx))
+-        return SNMPERR_GENERR;
++    ctx = EVP_MD_CTX_new();
+ #endif
++    if (!ctx)
++        return SNMPERR_GENERR;
+ #ifndef NETSNMP_DISABLE_MD5
+     if (ISTRANSFORM(hashtype, HMACMD5Auth)) {
+         if (!EVP_DigestInit(ctx, EVP_md5()))
+@@ -259,11 +259,10 @@ generate_Ku(const oid * hashtype, u_int
+     memset(buf, 0, sizeof(buf));
+ #ifdef NETSNMP_USE_OPENSSL
+     if (ctx) {
+-#ifdef HAVE_EVP_MD_CTX_DESTROY
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
+         EVP_MD_CTX_destroy(ctx);
+ #else
+-        EVP_MD_CTX_cleanup(ctx);
+-        free(ctx);
++        EVP_MD_CTX_free(ctx);
+ #endif
+     }
+ #endif
+--- snmplib/scapi.c
++++ snmplib/scapi.c
+@@ -486,15 +486,10 @@ sc_hash(const oid * hashtype, size_t has
+     }
+ 
+ /** initialize the pointer */
+-#ifdef HAVE_EVP_MD_CTX_CREATE
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
+     cptr = EVP_MD_CTX_create();
+ #else
+-    cptr = malloc(sizeof(*cptr));
+-#if defined(OLD_DES)
+-    memset(cptr, 0, sizeof(*cptr));
+-#else
+-    EVP_MD_CTX_init(cptr);
+-#endif
++    cptr = EVP_MD_CTX_new();
+ #endif
+     if (!EVP_DigestInit(cptr, hashfn)) {
+         /* requested hash function is not available */
+@@ -507,13 +502,11 @@ sc_hash(const oid * hashtype, size_t has
+ /** do the final pass */
+     EVP_DigestFinal(cptr, MAC, &tmp_len);
+     *MAC_len = tmp_len;
+-#ifdef HAVE_EVP_MD_CTX_DESTROY
++
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
+     EVP_MD_CTX_destroy(cptr);
+ #else
+-#if !defined(OLD_DES)
+-    EVP_MD_CTX_cleanup(cptr);
+-#endif
+-    free(cptr);
++    EVP_MD_CTX_free(cptr);
+ #endif
+     return (rval);
+ 
+
+--- snmplib/snmp_openssl.c	2014-12-08 21:23:22.000000000 +0100
++++ snmplib/snmp_openssl.c	2017-02-20 12:46:00.059727928 +0100
+@@ -47,7 +47,7 @@ void netsnmp_init_openssl(void) {
+     DEBUGMSGTL(("snmp_openssl", "initializing\n"));
+ 
+     /* Initializing OpenSSL */
+-    SSL_library_init();
++    OPENSSL_init_ssl(0, NULL);
+     SSL_load_error_strings();
+     ERR_load_BIO_strings();
+     OpenSSL_add_all_algorithms();
+@@ -164,11 +164,11 @@ netsnmp_openssl_cert_dump_names(X509 *oc
+         oname_entry = X509_NAME_get_entry(osubj_name, i);
+         netsnmp_assert(NULL != oname_entry);
+ 
+-        if (oname_entry->value->type != V_ASN1_PRINTABLESTRING)
++        if (X509_NAME_ENTRY_get_data(oname_entry)->type != V_ASN1_PRINTABLESTRING)
+             continue;
+ 
+         /** get NID */
+-        onid = OBJ_obj2nid(oname_entry->object);
++        onid = OBJ_obj2nid(X509_NAME_ENTRY_get_object(oname_entry));
+         if (onid == NID_undef) {
+             prefix_long = prefix_short = "UNKNOWN";
+         }
+@@ -179,9 +179,9 @@ netsnmp_openssl_cert_dump_names(X509 *oc
+ 
+         DEBUGMSGT(("9:cert:dump:names",
+                    "[%02d] NID type %d, ASN type %d\n", i, onid,
+-                   oname_entry->value->type));
++                   X509_NAME_ENTRY_get_data(oname_entry)->type));
+         DEBUGMSGT(("9:cert:dump:names", "%s/%s: '%s'\n", prefix_long,
+-                   prefix_short, ASN1_STRING_data(oname_entry->value)));
++                   prefix_short, ASN1_STRING_data(X509_NAME_ENTRY_get_data(oname_entry))));
+     }
+ }
+ #endif /* NETSNMP_FEATURE_REMOVE_CERT_DUMP_NAMES */
+@@ -470,7 +470,7 @@ netsnmp_openssl_cert_get_hash_type(X509
+     if (NULL == ocert)
+         return 0;
+ 
+-    return _nid2ht(OBJ_obj2nid(ocert->sig_alg->algorithm));
++    return _nid2ht(X509_get_signature_nid(ocert));
+ }
+ 
+ /**
+@@ -487,7 +487,7 @@ netsnmp_openssl_cert_get_fingerprint(X50
+     if (NULL == ocert)
+         return NULL;
+ 
+-    nid = OBJ_obj2nid(ocert->sig_alg->algorithm);
++    nid = X509_get_signature_nid(ocert);
+     DEBUGMSGT(("9:openssl:fingerprint", "alg %d, cert nid %d (%d)\n", alg, nid,
+                _nid2ht(nid)));
+         
+

Modified: head/net-mgmt/net-snmp/files/patch-Makefile.in
==============================================================================
--- head/net-mgmt/net-snmp/files/patch-Makefile.in	Mon Sep 30 21:34:22 2019	(r513421)
+++ head/net-mgmt/net-snmp/files/patch-Makefile.in	Mon Sep 30 21:45:46 2019	(r513422)
@@ -1,19 +1,19 @@
---- Makefile.in.orig	2018-07-16 14:33:40 UTC
+--- Makefile.in.orig	2014-12-08 20:23:22 UTC
 +++ Makefile.in
-@@ -22,7 +22,7 @@ INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi
- 	dragonfly.h dynix.h \
+@@ -21,7 +21,7 @@ INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi
+ 	darwin.h darwin7.h darwin8.h darwin9.h darwin10.h dragonfly.h dynix.h \
  	freebsd2.h freebsd3.h freebsd4.h freebsd5.h freebsd6.h \
  	freebsd7.h freebsd8.h freebsd9.h freebsd10.h freebsd11.h \
--	freebsd12.h freebsd.h kfreebsd.h \
-+	freebsd12.h freebsd13.h freebsd.h kfreebsd.h \
- 	generic.h \
- 	hpux.h irix.h linux.h mingw32.h mingw32msvc.h mips.h \
- 	netbsd.h nto-qnx6.h osf5.h \
-@@ -234,7 +234,7 @@ pythonmodules: subdirs
+-	freebsd12.h freebsd.h \
++	freebsd12.h freebsd13.h freebsd.h \
+         generic.h \
+ 	hpux.h irix.h linux.h mingw32.h mips.h netbsd.h osf5.h \
+ 	openbsd.h openbsd5.h openbsd4.h \
+@@ -230,7 +230,7 @@ pythonmodules: subdirs
          fi
  
  pythoninstall:
--	@(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir --root=$(DESTDIR) --prefix=$(prefix)) ; \
+-	@(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir) ; \
 +	@(dir=`pwd`; cd python; $(PYMAKE) install --root=${STAGEDIR} --basedir=$$dir ${PYDISTUTILS_INSTALLARGS}) ; \
          if test $$? != 0 ; then \
             exit 1 ; \

Copied: head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu_sysctl.c (from r513139, head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu_sysctl.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu_sysctl.c	Mon Sep 30 21:45:46 2019	(r513422, copy of r513139, head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu_sysctl.c)
@@ -0,0 +1,49 @@
+--- agent/mibgroup/hardware/cpu/cpu_sysctl.c.orig	2014-12-08 12:23:22.000000000 -0800
++++ agent/mibgroup/hardware/cpu/cpu_sysctl.c	2017-04-20 15:05:11.607496000 -0700
+@@ -130,8 +130,21 @@
+ #endif  /* VM_UVMEXP2 || VM_UVMEXP */
+ 
+ #elif defined(__FreeBSD__)                /* FreeBSD */
++#if __FreeBSD_version >= 1200028
++#define	VMMETER_TYPE	uint64_t
++#else
++#define	VMMETER_TYPE	u_int
++#endif
++struct __vmmeter {
++	VMMETER_TYPE	v_intr;
++	VMMETER_TYPE	v_swtch;
++	VMMETER_TYPE	v_swappgsin;
++	VMMETER_TYPE	v_swappgsout;
++	VMMETER_TYPE	v_swapin;
++	VMMETER_TYPE	v_swapout;
++};
+ #define NETSNMP_VM_STATS       VM_METER
+-#define NETSNMP_VM_STATS_TYPE  struct vmmeter
++#define NETSNMP_VM_STATS_TYPE  struct __vmmeter
+     #define NS_VM_INTR		v_intr
+     #define NS_VM_SWTCH		v_swtch
+     #define NS_VM_PAGEIN	v_swappgsin
+@@ -206,7 +219,23 @@
+          * Interrupt/Context Switch statistics
+          *   XXX - Do these really belong here ?
+          */
++#ifdef __FreeBSD__
++#define	GET_VM_STATS(space, name) sysctlbyname("vm.stats." #space "." #name, &mem_stats.name, &len, NULL, 0)
++    {
++	size_t len;
++
++	len = sizeof(VMMETER_TYPE);
++	GET_VM_STATS(sys, v_intr);
++	GET_VM_STATS(sys, v_swtch);
++	GET_VM_STATS(vm, v_swappgsin);
++	GET_VM_STATS(vm, v_swappgsout);
++	GET_VM_STATS(vm, v_swapin);
++	GET_VM_STATS(vm, v_swapout);
++    }
++#undef GET_VM_STATS
++#else
+     sysctl(mem_mib, 2, &mem_stats, &mem_size, NULL, 0);
++#endif
+     cpu->nInterrupts  = mem_stats.NS_VM_INTR;
+     cpu->nCtxSwitches = mem_stats.NS_VM_SWTCH;
+     cpu->swapIn       = mem_stats.NS_VM_SWAPIN;

Copied: head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_fsys_fsys__getfsstats.c (from r513139, head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_fsys_fsys__getfsstats.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_fsys_fsys__getfsstats.c	Mon Sep 30 21:45:46 2019	(r513422, copy of r513139, head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_fsys_fsys__getfsstats.c)
@@ -0,0 +1,11 @@
+--- agent/mibgroup/hardware/fsys/fsys_getfsstats.c.orig	2017-03-22 16:28:29 UTC
++++ agent/mibgroup/hardware/fsys/fsys_getfsstats.c
+@@ -116,7 +116,7 @@ netsnmp_fsys_arch_load( void )
+     /*
+      * Retrieve information about the currently mounted filesystems...
+      */
+-    n = NSFS_GETFSSTAT( NULL, 0, 0 );
++    n = NSFS_GETFSSTAT( NULL, 0, MNT_NOWAIT );
+     if ( n==0 )
+         return;
+     stats = (struct NSFS_STATFS *)malloc( n * sizeof( struct NSFS_STATFS ));

Modified: head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_memory_memory__freebsd.c
==============================================================================
--- head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_memory_memory__freebsd.c	Mon Sep 30 21:34:22 2019	(r513421)
+++ head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_memory_memory__freebsd.c	Mon Sep 30 21:45:46 2019	(r513422)
@@ -1,6 +1,6 @@
---- agent/mibgroup/hardware/memory/memory_freebsd.c.orig	2018-07-16 14:33:40 UTC
+--- agent/mibgroup/hardware/memory/memory_freebsd.c.orig	2015-02-20 14:44:47 UTC
 +++ agent/mibgroup/hardware/memory/memory_freebsd.c
-@@ -163,7 +163,7 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void 
+@@ -163,7 +163,7 @@ int netsnmp_mem_arch_load( netsnmp_cache
          if (!mem->descr)
               mem->descr = strdup("Cached memory");
          mem->units = pagesize;

Modified: head/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_icmp.h
==============================================================================
--- head/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_icmp.h	Mon Sep 30 21:34:22 2019	(r513421)
+++ head/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_icmp.h	Mon Sep 30 21:45:46 2019	(r513422)
@@ -1,9 +1,11 @@
---- agent/mibgroup/mibII/icmp.h.orig	2018-07-16 16:33:40.000000000 +0200
-+++ agent/mibgroup/mibII/icmp.h	2019-06-15 17:15:20.270320000 +0200
-@@ -16,6 +16,7 @@
+--- agent/mibgroup/mibII/icmp.h.orig	2014-12-08 20:23:22 UTC
++++ agent/mibgroup/mibII/icmp.h
+@@ -14,6 +14,9 @@ config_arch_require(freebsd7,  mibII/ker
+ config_arch_require(freebsd8,  mibII/kernel_sysctl)
+ config_arch_require(freebsd9,  mibII/kernel_sysctl)
  config_arch_require(freebsd10, mibII/kernel_sysctl)
- config_arch_require(freebsd11, mibII/kernel_sysctl)
- config_arch_require(freebsd12, mibII/kernel_sysctl)
++config_arch_require(freebsd11, mibII/kernel_sysctl)
++config_arch_require(freebsd12, mibII/kernel_sysctl)
 +config_arch_require(freebsd13, mibII/kernel_sysctl)
  config_arch_require(netbsd,    mibII/kernel_netbsd)
  config_arch_require(netbsdelf, mibII/kernel_netbsd)

Modified: head/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c
==============================================================================
--- head/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c	Mon Sep 30 21:34:22 2019	(r513421)
+++ head/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c	Mon Sep 30 21:45:46 2019	(r513422)
@@ -1,6 +1,6 @@
---- agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c.orig	2018-07-16 14:33:40 UTC
-+++ agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c
-@@ -163,7 +163,11 @@ _load(netsnmp_container *container, u_int load_flags)
+--- agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c.orig	2017-03-15 18:15:07.000000000 +0000
++++ agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c	2017-03-15 18:15:07.000000000 +0000
+@@ -163,7 +163,11 @@
  #else
  	xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
  #endif
@@ -12,12 +12,12 @@
  
  	if (load_flags) {
  	    if (state == TCPCONNECTIONSTATE_LISTEN) {
-@@ -223,6 +227,8 @@ _load(netsnmp_container *container, u_int load_flags)
+@@ -215,6 +219,8 @@
          entry->arbitrary_index = CONTAINER_SIZE(container) + 1;
          CONTAINER_INSERT(container, entry);
      }
 +
 +    free(tcpcb_buf);
  
-     free(tcpcb_buf);
- 
+     if(rc<0)
+         return rc;

Copied: head/net-mgmt/net-snmp/files/patch-agent_mibgroup_ucd-snmp_diskio.c (from r513139, head/net-mgmt/net-snmp/files/patch-agent_mibgroup_ucd-snmp_diskio.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/net-snmp/files/patch-agent_mibgroup_ucd-snmp_diskio.c	Mon Sep 30 21:45:46 2019	(r513422, copy of r513139, head/net-mgmt/net-snmp/files/patch-agent_mibgroup_ucd-snmp_diskio.c)
@@ -0,0 +1,54 @@
+--- agent/mibgroup/ucd-snmp/diskio.c.orig	2014-12-08 20:23:22 UTC
++++ agent/mibgroup/ucd-snmp/diskio.c
+@@ -944,14 +944,14 @@ var_diskio(struct variable * vp,
+         return (u_char *) stat->dinfo->devices[indx].device_name;
+     case DISKIO_NREAD:
+ #if HAVE_DEVSTAT_GETDEVS
+-        long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_READ];
++        long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_READ] & 0xFFFFFFFF;
+ #else
+         long_ret = (signed long) stat->dinfo->devices[indx].bytes_read;
+ #endif
+         return (u_char *) & long_ret;
+     case DISKIO_NWRITTEN:
+ #if HAVE_DEVSTAT_GETDEVS
+-        long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE];
++        long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE] & 0xFFFFFFFF;
+ #else
+         long_ret = (signed long) stat->dinfo->devices[indx].bytes_written;
+ #endif
+@@ -959,7 +959,7 @@ var_diskio(struct variable * vp,
+     case DISKIO_NREADX:
+         *var_len = sizeof(struct counter64);
+ #if HAVE_DEVSTAT_GETDEVS
+-        longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_READ];
++        longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_READ] & 0xFFFFFFFF;
+ #else
+         longlong_ret = stat->dinfo->devices[indx].bytes_read;
+ #endif
+@@ -969,7 +969,7 @@ var_diskio(struct variable * vp,
+     case DISKIO_NWRITTENX:
+         *var_len = sizeof(struct counter64);
+ #if HAVE_DEVSTAT_GETDEVS
+-        longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE];
++        longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE] & 0xFFFFFFFF;
+ #else
+         longlong_ret = stat->dinfo->devices[indx].bytes_written;
+ #endif
+@@ -978,14 +978,14 @@ var_diskio(struct variable * vp,
+         return (u_char *) & c64_ret;
+     case DISKIO_READS:
+ #if HAVE_DEVSTAT_GETDEVS
+-        long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_READ];
++        long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_READ] & 0xFFFFFFFF;
+ #else
+         long_ret = (signed long) stat->dinfo->devices[indx].num_reads;
+ #endif
+         return (u_char *) & long_ret;
+     case DISKIO_WRITES:
+ #if HAVE_DEVSTAT_GETDEVS
+-        long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_WRITE];
++        long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_WRITE] & 0xFFFFFFFF;
+ #else
+         long_ret = (signed long) stat->dinfo->devices[indx].num_writes;
+ #endif

Modified: head/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c
==============================================================================
--- head/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c	Mon Sep 30 21:34:22 2019	(r513421)
+++ head/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c	Mon Sep 30 21:45:46 2019	(r513422)
@@ -1,6 +1,18 @@
---- agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c.orig	2018-07-16 14:33:40 UTC
-+++ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c
-@@ -168,9 +168,24 @@ _load(netsnmp_container *container, u_int load_flags)
+--- agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c.orig	2014-12-08 12:23:22.000000000 -0800
++++ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c	2017-04-07 16:05:05.752849000 -0700
+@@ -153,7 +153,11 @@
+ #endif
+ 
+ #if !defined(NETSNMP_ENABLE_IPV6)
++#if __FreeBSD_version >= 1200026
++	if (pcb.inp_vflag & INP_IPV6)
++#else
+         if (pcb.xi_inp.inp_vflag & INP_IPV6)
++#endif
+ 	    continue;
+ #endif
+ 
+@@ -164,9 +168,24 @@
          }
  
          /** oddly enough, these appear to already be in network order */
@@ -25,8 +37,8 @@
 -        entry->pid = 0;
          
          /** the addr string may need work */
- #ifdef INP_ISIPV6
-@@ -187,6 +202,8 @@ _load(netsnmp_container *container, u_int load_flags)
+ 	if (pcb.xi_inp.inp_vflag & INP_IPV6) {
+@@ -179,6 +198,8 @@
  	    memcpy(entry->loc_addr, &pcb.xi_inp.inp_laddr, 4);
  	    memcpy(entry->rmt_addr, &pcb.xi_inp.inp_faddr, 4);
  	}
@@ -35,12 +47,12 @@
  
          /*
           * add entry to container
-@@ -194,6 +211,8 @@ _load(netsnmp_container *container, u_int load_flags)
- 	entry->index = CONTAINER_SIZE(container) + 1;
+@@ -187,6 +208,8 @@
          CONTAINER_INSERT(container, entry);
      }
-+
-+    free(udpcb_buf);
  
-     free(udpcb_buf);
++    free(udpcb_buf);
++
+     if(rc<0)
+         return rc;
  

Copied: head/net-mgmt/net-snmp/files/patch-include__net-snmp__net-snmp-config.h.in (from r513139, head/net-mgmt/net-snmp/files/patch-include__net-snmp__net-snmp-config.h.in)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/net-snmp/files/patch-include__net-snmp__net-snmp-config.h.in	Mon Sep 30 21:45:46 2019	(r513422, copy of r513139, head/net-mgmt/net-snmp/files/patch-include__net-snmp__net-snmp-config.h.in)
@@ -0,0 +1,11 @@
+--- ./include/net-snmp/net-snmp-config.h.in.orig	2012-10-09 18:28:58.000000000 -0400
++++ ./include/net-snmp/net-snmp-config.h.in	2012-10-14 11:37:35.000000000 -0400
+@@ -2106,7 +2106,7 @@
+ #define UCD_SNMP_LIBRARY 1
+ 
+ /* final conclusion on nlist usage */
+-#if defined(HAVE_NLIST) && defined(HAVE_STRUCT_NLIST_N_VALUE) && !defined(NETSNMP_DONT_USE_NLIST) && defined(HAVE_KMEM) && !defined(NETSNMP_NO_KMEM_USAGE)
++#if defined(HAVE_NLIST) && defined(HAVE_STRUCT_NLIST_N_VALUE) && !defined(NETSNMP_DONT_USE_NLIST) && !defined(NETSNMP_NO_KMEM_USAGE)
+ #define NETSNMP_CAN_USE_NLIST
+ #endif
+ 

Modified: head/net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd13.h
==============================================================================
--- head/net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd13.h	Mon Sep 30 21:34:22 2019	(r513421)
+++ head/net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd13.h	Mon Sep 30 21:45:46 2019	(r513422)
@@ -1,6 +1,6 @@
---- include/net-snmp/system/freebsd13.h.orig	2019-03-07 15:59:25 UTC
+--- include/net-snmp/system/freebsd13.h.orig	2018-12-25 15:35:28 UTC
 +++ include/net-snmp/system/freebsd13.h
 @@ -0,0 +1,3 @@
-+/* freebsd12 is a superset of freebsd11 */
-+#include "freebsd11.h"
-+#define freebsd11 freebsd11
++/* freebsd13 is a superset of freebsd12 */
++#include "freebsd12.h"
++#define freebsd13 freebsd13

Copied: head/net-mgmt/net-snmp/files/patch-kthreads (from r513139, head/net-mgmt/net-snmp/files/patch-kthreads)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/net-snmp/files/patch-kthreads	Mon Sep 30 21:45:46 2019	(r513422, copy of r513139, head/net-mgmt/net-snmp/files/patch-kthreads)
@@ -0,0 +1,96 @@
+diff --git a/agent/mibgroup/host/data_access/swrun.c b/agent/mibgroup/host/data_access/swrun.c
+index d18ea5f..60ad5b4 100644
+--- agent/mibgroup/host/data_access/swrun.c
++++ agent/mibgroup/host/data_access/swrun.c
+@@ -75,10 +75,27 @@ shutdown_swrun(void)
+ }
+ 
+ int
+-swrun_count_processes( void )
++swrun_count_processes(int include_kthreads)
+ {
++    netsnmp_swrun_entry *entry;
++    netsnmp_iterator  *it;
++    int i = 0;
++
+     netsnmp_cache_check_and_reload(swrun_cache);
+-    return ( swrun_container ? CONTAINER_SIZE(swrun_container) : 0 );
++    if ( !swrun_container )
++        return 0;    /* or -1 */
++
++    if (include_kthreads)
++	return ( swrun_container ? CONTAINER_SIZE(swrun_container) : 0 );
++
++    it = CONTAINER_ITERATOR( swrun_container );
++    while ((entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) != NULL) {
++        if (4 == entry->hrSWRunType)
++            i++;
++    }
++    ITERATOR_RELEASE( it );
++
++    return i;
+ }
+ 
+ #ifndef NETSNMP_FEATURE_REMOVE_SWRUN_MAX_PROCESSES
+diff --git a/agent/mibgroup/host/hr_system.c b/agent/mibgroup/host/hr_system.c
+index d99cc7d..e853779 100644
+--- agent/mibgroup/host/hr_system.c
++++ agent/mibgroup/host/hr_system.c
+@@ -24,6 +24,7 @@
+ 
+ #include <net-snmp/net-snmp-includes.h>
+ #include <net-snmp/agent/net-snmp-agent-includes.h>
++#include <net-snmp/data_access/swrun.h>
+ 
+ #include "host.h"
+ #include "host_res.h"
+@@ -114,7 +115,14 @@ static long     get_max_solaris_processes(void);
+ static int      get_load_dev(void);
+ static int      count_users(void);
+ extern int      count_processes(void);
+-extern int      swrun_count_processes(void);
++#if USING_HOST_DATA_ACCESS_SWRUN_MODULE
++static int      count_kthreads = 0;
++
++static void parse_count_kthreads(const char *token, const char *line)
++{
++    count_kthreads = atoi(line);
++}
++#endif
+ 
+         /*********************
+ 	 *
+@@ -194,6 +202,11 @@ init_hr_system(void)
+ #ifdef NPROC_SYMBOL
+     auto_nlist(NPROC_SYMBOL, 0, 0);
+ #endif
++#if USING_HOST_DATA_ACCESS_SWRUN_MODULE
++    snmpd_register_const_config_handler("count_kthreads",
++                                        parse_count_kthreads, NULL,
++					"0|1    0 to exclude kernel threads from hrSystemProcesses.0");
++#endif
+ 
+     REGISTER_MIB("host/hr_system", hrsystem_variables, variable2,
+                  hrsystem_variables_oid);
+@@ -317,7 +330,7 @@ var_hrsys(struct variable * vp,
+         return (u_char *) & long_return;
+     case HRSYS_PROCS:
+ #if USING_HOST_DATA_ACCESS_SWRUN_MODULE
+-        long_return = swrun_count_processes();
++        long_return = swrun_count_processes(count_kthreads);
+ #elif USING_HOST_HR_SWRUN_MODULE
+         long_return = count_processes();
+ #else
+diff --git a/include/net-snmp/data_access/swrun.h b/include/net-snmp/data_access/swrun.h
+index 3e15c41..4f768ac 100644
+--- include/net-snmp/data_access/swrun.h
++++ include/net-snmp/data_access/swrun.h
+@@ -85,7 +85,7 @@ extern "C" {
+ 
+     void netsnmp_swrun_entry_free(netsnmp_swrun_entry *entry);
+ 
+-    int  swrun_count_processes( void );
++    int  swrun_count_processes( int include_kthreads );
+     int  swrun_max_processes(   void );
+     int  swrun_count_processes_by_name( char *name );
+ 

Copied: head/net-mgmt/net-snmp/files/patch-perl5.23 (from r513139, head/net-mgmt/net-snmp/files/patch-perl5.23)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/net-snmp/files/patch-perl5.23	Mon Sep 30 21:45:46 2019	(r513422, copy of r513139, head/net-mgmt/net-snmp/files/patch-perl5.23)
@@ -0,0 +1,135 @@
+--- agent/snmp_perl.c.orig	2015-08-11 13:07:06 UTC
++++ agent/snmp_perl.c
+@@ -5,6 +5,10 @@
+ #include <EXTERN.h>
+ #include "perl.h"
+ 
++#ifdef U64TYPE
++#define U64 U64pairU32
++#endif
++
+ #include <net-snmp/net-snmp-config.h>
+ #include <net-snmp/net-snmp-includes.h>
+ #include <net-snmp/agent/net-snmp-agent-includes.h>
+--- perl/OID/OID.xs.orig	2015-08-11 13:07:28 UTC
++++ perl/OID/OID.xs
+@@ -7,6 +7,10 @@
+ #include "perl.h"
+ #include "XSUB.h"
+ 
++#ifdef U64TYPE
++#define U64 U64pairU32
++#endif
++
+ #include <net-snmp/net-snmp-config.h>
+ #include <net-snmp/net-snmp-includes.h>
+ 
+--- perl/SNMP/SNMP.xs.orig	2015-08-11 13:07:54 UTC
++++ perl/SNMP/SNMP.xs
+@@ -16,6 +16,10 @@
+ #include "perl.h"
+ #include "XSUB.h"
+ 
++#ifdef U64TYPE
++#define U64 U64pairU32
++#endif
++
+ #include <net-snmp/net-snmp-config.h>
+ #include <net-snmp/net-snmp-includes.h>
+ #include <sys/types.h>
+--- perl/TrapReceiver/TrapReceiver.xs.orig	2015-08-11 13:08:02 UTC
++++ perl/TrapReceiver/TrapReceiver.xs
+@@ -9,6 +9,10 @@
+ 
+ #include "ppport.h"
+ 
++#ifdef U64TYPE
++#define U64 U64pairU32
++#endif
++
+ #include <net-snmp/net-snmp-config.h>
+ #include <net-snmp/net-snmp-includes.h>
+ #include <net-snmp/agent/net-snmp-agent-includes.h>
+--- perl/agent/agent.xs.orig	2015-08-11 13:07:48 UTC
++++ perl/agent/agent.xs
+@@ -9,6 +9,10 @@
+ #include <netdb.h>
+ #include <sys/socket.h>
+ 
++#ifdef U64TYPE
++#define U64 U64pairU32
++#endif
++
+ #include <net-snmp/net-snmp-config.h>
+ #include <net-snmp/net-snmp-includes.h>
+ #include <net-snmp/agent/net-snmp-agent-includes.h>
+--- perl/ASN/Makefile.PL.orig	2014-12-08 20:23:22 UTC
++++ perl/ASN/Makefile.PL
+@@ -1,3 +1,4 @@
++package ASN;
+ use ExtUtils::MakeMaker;
+ require 5;
+ use Config;
+--- perl/AnyData_SNMP/Makefile.PL.orig	2015-09-03 22:27:45 UTC
++++ perl/AnyData_SNMP/Makefile.PL
+@@ -1,3 +1,4 @@
++package AnyData_SNMP;
+ use ExtUtils::MakeMaker;
+ # See lib/ExtUtils/MakeMaker.pm for details of how to influence
+ # the contents of the Makefile that is written.
+--- perl/OID/Makefile.PL.orig	2014-12-08 20:23:22 UTC
++++ perl/OID/Makefile.PL
+@@ -1,3 +1,4 @@
++package OID;
+ # See lib/ExtUtils/MakeMaker.pm for details of how to influence
+ # the contents of the Makefile that is written.
+ 
+--- perl/SNMP/Makefile.PL.orig	2014-12-08 20:23:22 UTC
++++ perl/SNMP/Makefile.PL
+@@ -1,3 +1,4 @@
++package SNMP;
+ use ExtUtils::MakeMaker;
+ require 5;
+ use Config;
+--- perl/TrapReceiver/Makefile.PL.orig	2014-12-08 20:23:22 UTC
++++ perl/TrapReceiver/Makefile.PL
+@@ -1,3 +1,4 @@
++package TrapReceiver;
+ use ExtUtils::MakeMaker;
+ require 5;
+ use Config;
+--- perl/agent/Makefile.PL.orig	2014-12-08 20:23:22 UTC
++++ perl/agent/Makefile.PL
+@@ -1,3 +1,4 @@
++package agent;
+ use ExtUtils::MakeMaker;
+ require 5;
+ use Config;
+--- perl/agent/Support/Makefile.PL.orig	2014-12-08 20:23:22 UTC
++++ perl/agent/Support/Makefile.PL
+@@ -1,3 +1,4 @@
++package agent_Support;
+ use ExtUtils::MakeMaker;
+ require 5;
+ use Config;
+--- perl/agent/default_store/Makefile.PL.orig	2014-12-08 20:23:22 UTC
++++ perl/agent/default_store/Makefile.PL
+@@ -1,3 +1,4 @@
++package agent_default_store;
+ use ExtUtils::MakeMaker;
+ require 5;
+ use Config;
+--- perl/default_store/Makefile.PL.orig	2014-12-08 20:23:22 UTC
++++ perl/default_store/Makefile.PL
+@@ -1,3 +1,4 @@
++package default_store;
+ use ExtUtils::MakeMaker;
+ require 5;
+ use Config;
+--- perl/manager/Makefile.PL.orig	2014-12-08 20:23:22 UTC
++++ perl/manager/Makefile.PL
+@@ -1,3 +1,4 @@
++package manager;
+ use ExtUtils::MakeMaker;
+ # See lib/ExtUtils/MakeMaker.pm for details of how to influence
+ # the contents of the Makefile that is written.

Copied: head/net-mgmt/net-snmp/files/patch-snmplib_snmp__api.c (from r513139, head/net-mgmt/net-snmp/files/patch-snmplib_snmp__api.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/net-snmp/files/patch-snmplib_snmp__api.c	Mon Sep 30 21:45:46 2019	(r513422, copy of r513139, head/net-mgmt/net-snmp/files/patch-snmplib_snmp__api.c)
@@ -0,0 +1,117 @@
+--- snmplib/snmp_api.c.orig	2014-12-08 20:23:22 UTC
++++ snmplib/snmp_api.c
+@@ -4350,10 +4350,9 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char 
+     u_char          type;
+     u_char          msg_type;
+     u_char         *var_val;
+-    int             badtype = 0;
+     size_t          len;
+     size_t          four;
+-    netsnmp_variable_list *vp = NULL;
++    netsnmp_variable_list *vp = NULL, *vplast = NULL;
+     oid             objid[MAX_OID_LEN];
+     u_char         *p;
+ 
+@@ -4493,38 +4492,24 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char 
+                               (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+                               "varbinds");
+     if (data == NULL)
+-        return -1;
++        goto fail;
+ 
+     /*
+      * get each varBind sequence 
+      */
+     while ((int) *length > 0) {
+-        netsnmp_variable_list *vptemp;
+-        vptemp = (netsnmp_variable_list *) malloc(sizeof(*vptemp));
+-        if (NULL == vptemp) {
+-            return -1;
+-        }
+-        if (NULL == vp) {
+-            pdu->variables = vptemp;
+-        } else {
+-            vp->next_variable = vptemp;
+-        }
+-        vp = vptemp;
++	vp = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);
++	if (NULL == vp)
++	    goto fail;
+ 
+-        vp->next_variable = NULL;
+-        vp->val.string = NULL;
+         vp->name_length = MAX_OID_LEN;
+-        vp->name = NULL;
+-        vp->index = 0;
+-        vp->data = NULL;
+-        vp->dataFreeHook = NULL;
+         DEBUGDUMPSECTION("recv", "VarBind");
+         data = snmp_parse_var_op(data, objid, &vp->name_length, &vp->type,
+                                  &vp->val_len, &var_val, length);
+         if (data == NULL)
+-            return -1;
++            goto fail;
+         if (snmp_set_var_objid(vp, objid, vp->name_length))
+-            return -1;
++            goto fail;
+ 
+         len = MAX_PACKET_LENGTH;
+         DEBUGDUMPHEADER("recv", "Value");
+@@ -4604,7 +4589,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char 
+                 vp->val.string = (u_char *) malloc(vp->val_len);
+             }
+             if (vp->val.string == NULL) {
+-                return -1;
++                goto fail;
+             }
+             p = asn_parse_string(var_val, &len, &vp->type, vp->val.string,
+                              &vp->val_len);
+@@ -4619,7 +4604,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char 
+             vp->val_len *= sizeof(oid);
+             vp->val.objid = (oid *) malloc(vp->val_len);
+             if (vp->val.objid == NULL) {
+-                return -1;
++                goto fail;
+             }
+             memmove(vp->val.objid, objid, vp->val_len);
+             break;
+@@ -4631,7 +4616,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char 
+         case ASN_BIT_STR:
+             vp->val.bitstring = (u_char *) malloc(vp->val_len);
+             if (vp->val.bitstring == NULL) {
+-                return -1;
++                goto fail;
+             }
+             p = asn_parse_bitstring(var_val, &len, &vp->type,
+                                 vp->val.bitstring, &vp->val_len);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909302145.x8ULjlkF026018>