- Update to 5.9

- Add OPTION to disable libpkg support
This commit is contained in:
Ryan Steinmetz 2020-09-12 12:57:29 +00:00
parent 3d0e2fec49
commit 7e0a22a273
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=548358
24 changed files with 53 additions and 989 deletions

View File

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= snmp
PORTVERSION= 5.7.3
PORTREVISION= 20
PORTVERSION= 5.9
PORTEPOCH= 1
CATEGORIES= net-mgmt
MASTER_SITES= SF/net-${PORTNAME}/net-${PORTNAME}/${PORTVERSION} \
@ -22,7 +21,7 @@ NOT_FOR_ARCHS_REASON= SSP is currently broken on MIPS
OPTIONS_DEFINE= IPV6 MFD_REWRITES PERL PERL_EMBEDDED PYTHON DUMMY TKMIB \
MYSQL AX_SOCKONLY UNPRIVILEGED SMUX DOCS JAIL AX_DISABLE_TRAP \
TLS NEWSYSLOG
TLS NEWSYSLOG NOLIBPKG
OPTIONS_DEFAULT=PERL PERL_EMBEDDED DUMMY SMUX NEWSYSLOG
OPTIONS_SUB= yes
@ -36,6 +35,7 @@ UNPRIVILEGED_DESC= Allow unprivileged users to execute net-snmp
SMUX_DESC= Build with SNMP multiplexing (SMUX) support
JAIL_DESC= Options for running snmpd within a jail(8)
NEWSYSLOG_DESC= Automatically rotate snmpd.log via newsyslog
NOLIBPKG_DESC= Build without libpkg
MAKE_JOBS_UNSAFE= yes
@ -74,10 +74,6 @@ TLS_CONFIGURE_ON= --with-security-modules=tsm --with-transports=TLSTCP,DTLSUDP
.include <bsd.port.options.mk>
.if (${OPSYS} == FreeBSD && ${OSVERSION} >= 1200085) || ${SSL_DEFAULT:Mopenssl}
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-openssl11
.endif
.if ${PORT_OPTIONS:MPYTHON}
PYDISTUTILS_PKGNAME?= netsnmp-python
PYDISTUTILS_PKGVERSION?= 1.0a1
@ -100,7 +96,6 @@ CONFIGURE_ARGS+=--with-dummy-values
.endif
.if ! ${PORT_OPTIONS:MTKMIB}
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-local_Makefile.in
PLIST_SUB+= WITH_TKMIB="@comment "
.else
RUN_DEPENDS+= p5-Tk>=0:x11-toolkits/p5-Tk
@ -150,8 +145,8 @@ PLIST_SUB+= WITH_IPV6="@comment "
CONFIGURE_ARGS+=--without-root-access
.endif
SHLIB_VERSION= 30
SHLIB_VERSION2= .0.3
SHLIB_VERSION= 40
SHLIB_VERSION2= .0.0
PLIST_SUB+= SHLIB_VERSION=${SHLIB_VERSION} SHLIB_VERSION2=${SHLIB_VERSION2}
SCRIPTS_SUB= PREFIX=${PREFIX} PERL=${PERL}
@ -196,7 +191,8 @@ CONFIGURE_ARGS+=--with-out-mib-modules="${NET_SNMP_WITHOUT_MIB_MODULE_LIST}"
BIN_FILES= snmpbulkwalk snmpget snmpgetnext snmpset \
snmpstatus snmptest snmptranslate snmptrap snmpwalk \
snmptable snmpbulkget snmpdelta snmpdf agentxtrap \
snmpvacm snmpusm encode_keychange snmpnetstat
snmpps snmpping snmppcap 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} \
@ -242,11 +238,6 @@ pre-everything::
@${ECHO_MSG}
post-patch:
.for filename in ${SCRIPT_FILES}
@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/local/${filename}
.endfor
@${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' \
${WRKSRC}/configure
.if (${OPSYS} == FreeBSD && ${OSVERSION} >= 1200085) || ${SSL_DEFAULT:Mopenssl}
@ -255,6 +246,19 @@ post-patch:
.endif
@${CP} ${WRKSRC}/include/net-snmp/system/freebsd12.h \
${WRKSRC}/include/net-snmp/system/freebsd13.h
.for header in darwin7.h darwin8.h darwin9.h darwin10.h darwin11.h darwin12.h \
darwin13.h darwin14.h darwin15.h darwin16.h darwin17.h
@${CP} ${WRKSRC}/include/net-snmp/system/darwin.h \
${WRKSRC}/include/net-snmp/system/${header}
.endfor
.if ${PORT_OPTIONS:MNOLIBPKG}
pre-configure:
${REINPLACE_CMD} \
-e 's|pkg[.]h|ignore-pkg.h|g' \
-e 's|in pkg ;|in ignore-pkg ;|' \
${WRKSRC}/configure
.endif
post-configure:
@${FIND} ${WRKSRC} -name Makefile | \
@ -294,7 +298,7 @@ post-install: strip-files install-config-files install-doc-files
@(cd ${STAGEDIR}${PREFIX}/lib && ${LN} -sf libnetsnmptrapd.so.${SHLIB_VERSION} libnetsnmptrapd.so)
.if ${PORT_OPTIONS:MNEWSYSLOG}
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d
${INSTALL_DATA} ${FILESDIR}/net-snmp.conf ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/
${INSTALL_DATA} ${FILESDIR}/net-snmp.conf ${STAGEDIR}${DATADIR}/newsyslog.conf.sample
.endif
strip-files:

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1538855961
SHA256 (net-snmp-5.7.3.tar.gz) = 12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0
SIZE (net-snmp-5.7.3.tar.gz) = 6382428
TIMESTAMP = 1599226037
SHA256 (net-snmp-5.9.tar.gz) = 04303a66f85d6d8b16d3cc53bde50428877c82ab524e17591dfceaeb94df6071
SIZE (net-snmp-5.9.tar.gz) = 6690435

View File

@ -1,11 +0,0 @@
--- local/Makefile.in.orig 2015-01-19 14:37:56 UTC
+++ local/Makefile.in
@@ -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
+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 \

View File

@ -1,223 +0,0 @@
--- 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)));

View File

@ -1,20 +0,0 @@
--- Makefile.in.orig 2014-12-08 20:23:22 UTC
+++ Makefile.in
@@ -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 \
+ 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) ; \
+ @(dir=`pwd`; cd python; $(PYMAKE) install --root=${STAGEDIR} --basedir=$$dir ${PYDISTUTILS_INSTALLARGS}) ; \
if test $$? != 0 ; then \
exit 1 ; \
fi

View File

@ -1,11 +0,0 @@
--- agent/Makefile.in.orig 2015-01-19 16:46:08 UTC
+++ agent/Makefile.in
@@ -120,7 +120,7 @@ LMIBLIBS = @LMIBLIBS@
VAL_LIBS = @VAL_LIBS@
PERLLDOPTS_FOR_APPS = @PERLLDOPTS_FOR_APPS@
PERLLDOPTS_FOR_LIBS = @PERLLDOPTS_FOR_LIBS@
-LIBS = $(USELIBS) @AGENTLIBS@ $(PERLLDOPTS_FOR_APPS) $(VAL_LIBS)
+LIBS = $(USELIBS) @AGENTLIBS@ $(PERLLDOPTS_FOR_APPS) $(VAL_LIBS) -lpkg
OUR_AGENT_LIBS = $(AGENTLIB) $(MIBLIB) $(LIBS) @DLLIBS@
CPPFLAGS = $(TOP_INCLUDES) -I. $(AGENT_INCLUDES) $(MIBGROUP_INCLUDES) \
$(SNMPLIB_INCLUDES) @CPPFLAGS@

View File

@ -1,49 +0,0 @@
--- 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;

View File

@ -1,11 +0,0 @@
--- 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 ));

View File

@ -1,11 +0,0 @@
--- 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
if (!mem->descr)
mem->descr = strdup("Cached memory");
mem->units = pagesize;
- mem->size = cache_count;
+ mem->size = cache_count + inact_count;
mem->free = 0;
}

View File

@ -1,24 +0,0 @@
--- agent/mibgroup/if-mib/data_access/interface_sysctl.c.orig 2018-07-16 16:33:40 UTC
+++ agent/mibgroup/if-mib/data_access/interface_sysctl.c
@@ -531,8 +531,11 @@
}
}
adl = (struct sockaddr_dl *) a;
- if_name = (char *) adl->sdl_data;
- if_name[adl->sdl_nlen] = '\0';
+ if_name = malloc(adl->sdl_nlen + 1);
+ if (if_name) {
+ memcpy(if_name, adl->sdl_data, adl->sdl_nlen);
+ if_name[adl->sdl_nlen] = '\0';
+ }
}
if (!(ifp->ifm_addrs & RTA_IFP) || if_name == NULL) {
snmp_log(LOG_ERR, "ifm_index %u: no interface name in message, "
@@ -541,6 +544,7 @@
}
entry = netsnmp_access_interface_entry_create(if_name, ifp->ifm_index);
+ free(if_name);
if(NULL == entry) {
netsnmp_access_interface_container_free(container,
NETSNMP_ACCESS_INTERFACE_FREE_NOFLAGS);

View File

@ -1,12 +0,0 @@
--- 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(freebsd13, mibII/kernel_sysctl)
config_arch_require(netbsd, mibII/kernel_netbsd)
config_arch_require(netbsdelf, mibII/kernel_netbsd)
config_arch_require(openbsd4, mibII/kernel_sysctl)

View File

@ -1,23 +0,0 @@
--- 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
+#if __FreeBSD_version >= 1200026
+ state = StateMap[pcb.t_state];
+#else
state = StateMap[pcb.xt_tp.t_state];
+#endif
if (load_flags) {
if (state == TCPCONNECTIONSTATE_LISTEN) {
@@ -215,6 +219,8 @@
entry->arbitrary_index = CONTAINER_SIZE(container) + 1;
CONTAINER_INSERT(container, entry);
}
+
+ free(tcpcb_buf);
if(rc<0)
return rc;

View File

@ -1,54 +0,0 @@
--- 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

View File

@ -1,58 +0,0 @@
--- 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 */
+#if __FreeBSD_version >= 1200026
+ entry->loc_port = htons(pcb.inp_lport);
+ entry->rmt_port = htons(pcb.inp_fport);
+
+ /** the addr string may need work */
+ if (pcb.inp_vflag & INP_IPV6) {
+ entry->loc_addr_len = entry->rmt_addr_len = 16;
+ memcpy(entry->loc_addr, &pcb.in6p_laddr, 16);
+ memcpy(entry->rmt_addr, &pcb.in6p_faddr, 16);
+ }
+ else {
+ entry->loc_addr_len = entry->rmt_addr_len = 4;
+ memcpy(entry->loc_addr, &pcb.inp_laddr, 4);
+ memcpy(entry->rmt_addr, &pcb.inp_faddr, 4);
+ }
+#else
entry->loc_port = htons(pcb.xi_inp.inp_lport);
entry->rmt_port = htons(pcb.xi_inp.inp_fport);
- entry->pid = 0;
/** the addr string may need work */
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);
}
+#endif
+ entry->pid = 0;
/*
* add entry to container
@@ -187,6 +208,8 @@
CONTAINER_INSERT(container, entry);
}
+ free(udpcb_buf);
+
if(rc<0)
return rc;

View File

@ -1,11 +0,0 @@
--- ./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

View File

@ -1,6 +0,0 @@
--- include/net-snmp/system/freebsd13.h.orig 2018-12-25 15:35:28 UTC
+++ include/net-snmp/system/freebsd13.h
@@ -0,0 +1,3 @@
+/* freebsd13 is a superset of freebsd12 */
+#include "freebsd12.h"
+#define freebsd13 freebsd13

View File

@ -1,96 +0,0 @@
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 );

View File

@ -1,135 +0,0 @@
--- 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.

View File

@ -1,117 +0,0 @@
--- 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);
@@ -4640,12 +4625,28 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
break;
default:
snmp_log(LOG_ERR, "bad type returned (%x)\n", vp->type);
- badtype = -1;
+ goto fail;
break;
}
DEBUGINDENTADD(-4);
+
+ if (NULL == vplast) {
+ pdu->variables = vp;
+ } else {
+ vplast->next_variable = vp;
+ }
+ vplast = vp;
+ vp = NULL;
}
- return badtype;
+ return 0;
+
+ fail:
+ DEBUGMSGTL(("recv", "error while parsing VarBindList\n"));
+ /** if we were parsing a var, remove it from the pdu and free it */
+ if (vp)
+ snmp_free_var(vp);
+
+ return -1;
}
/*

View File

@ -1,11 +0,0 @@
--- snmplib/snmpusm.c.orig 2011-07-27 09:58:24.000000000 -0300
+++ snmplib/snmpusm.c 2011-07-27 09:57:48.000000000 -0300
@@ -91,6 +91,8 @@
oid usmAESPrivProtocol[10] = { 1, 3, 6, 1, 6, 3, 10, 1, 2, 4 };
/* backwards compat */
oid *usmAES128PrivProtocol = usmAESPrivProtocol;
+oid *usmAES192PrivProtocol = usmAESPrivProtocol;
+oid *usmAES256PrivProtocol = usmAESPrivProtocol;
static u_int dummy_etime, dummy_eboot; /* For ISENGINEKNOWN(). */

View File

@ -1,46 +0,0 @@
--- agent/mibgroup/mibII/tcpTable.c.orig 2017-03-15 17:46:37.000000000 +0000
+++ agent/mibgroup/mibII/tcpTable.c 2017-03-15 17:46:37.000000000 +0000
@@ -96,7 +96,11 @@
typedef struct netsnmp_inpcb_s netsnmp_inpcb;
struct netsnmp_inpcb_s {
+#if __FreeBSD_version >= 1200026
+ struct xinpcb pcb;
+#else
struct inpcb pcb;
+#endif
int state;
netsnmp_inpcb *inp_next;
};
@@ -301,8 +305,10 @@
#ifndef NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS
int
TCP_Count_Connections( void ) {
+#if (defined(CAN_USE_SYSCTL) && defined(TCPCTL_PCBLIST))
tcpTable_load(NULL, NULL);
return tcp_estab;
+#endif
}
#endif /* NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS */
@@ -923,12 +929,20 @@
nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
if (!nnew)
break;
+#if __FreeBSD_version >= 1200026
+ nnew->state = StateMap[((NS_ELEM *) xig)->t_state];
+#else
nnew->state = StateMap[((NS_ELEM *) xig)->xt_tp.t_state];
+#endif
if (nnew->state == 5 /* established */ ||
nnew->state == 8 /* closeWait */ )
tcp_estab++;
memcpy(&(nnew->pcb), &(((NS_ELEM *) xig)->xt_inp),
+#if __FreeBSD_version >= 1200026
+ sizeof(struct xinpcb));
+#else
sizeof(struct inpcb));
+#endif
if (nnew->pcb.inp_vflag & INP_IPV6)
free(nnew);

View File

@ -1,11 +0,0 @@
--- include/net-snmp/library/transform_oids.h.orig 2006-10-28 05:19:44.000000000 +0900
+++ include/net-snmp/library/transform_oids.h 2008-03-26 07:50:45.393507729 +0900
@@ -23,6 +23,8 @@
/* XXX: OIDs not defined yet */
NETSNMP_IMPORT oid usmAESPrivProtocol[10]; /* == { 1,3,6,1,6,3,10,1,2,4 }; */
NETSNMP_IMPORT oid *usmAES128PrivProtocol; /* backwards compat */
+NETSNMP_IMPORT oid *usmAES192PrivProtocol; /* backwards compat */
+NETSNMP_IMPORT oid *usmAES256PrivProtocol; /* backwards compat */
#define USM_AUTH_PROTO_NOAUTH_LEN 10
#define USM_AUTH_PROTO_MD5_LEN 10

View File

@ -1,26 +0,0 @@
--- agent/mibgroup/mibII/udpTable.c.orig 2017-03-15 18:08:43.000000000 +0000
+++ agent/mibgroup/mibII/udpTable.c 2017-03-15 18:08:43.000000000 +0000
@@ -71,7 +71,11 @@
#if defined(freebsd4) || defined(darwin) || defined(osf5)
typedef struct netsnmp_inpcb_s netsnmp_inpcb;
struct netsnmp_inpcb_s {
+#if __FreeBSD_version >= 1200026
+ struct xinpcb pcb;
+#else
struct inpcb pcb;
+#endif
int state;
netsnmp_inpcb *inp_next;
};
@@ -670,7 +674,11 @@
nnew = SNMP_MALLOC_TYPEDEF(UDPTABLE_ENTRY_TYPE);
if (!nnew)
break;
+#if __FreeBSD_version >= 1200026
+ memcpy(&nnew->pcb, xig, sizeof(struct xinpcb));
+#else
memcpy(&nnew->pcb, &((struct xinpcb *) xig)->xi_inp, sizeof(struct inpcb));
+#endif
nnew->inp_next = udp_head;
udp_head = nnew;
#if defined(dragonfly)

View File

@ -1,4 +1,5 @@
bin/agentxtrap
bin/checkbandwidth
bin/encode_keychange
bin/fixproc
bin/ipf-mod.pl
@ -10,6 +11,7 @@ bin/net-snmp-create-v3-user
bin/snmp-bridge-mib
bin/snmpbulkget
bin/snmpbulkwalk
bin/snmppcap
bin/snmpcheck
bin/snmpconf
bin/snmpdelta
@ -18,10 +20,13 @@ bin/snmpget
bin/snmpgetnext
bin/snmpinform
bin/snmpnetstat
bin/snmpping
bin/snmpps
bin/snmpset
bin/snmpstatus
bin/snmptable
bin/snmptest
bin/snmptop
%%TLS%%bin/snmptls
bin/snmptranslate
bin/snmptrap
@ -30,7 +35,8 @@ bin/snmpvacm
bin/snmpwalk
%%WITH_TKMIB%%bin/tkmib
bin/traptoemail
%%NEWSYSLOG%%etc/newsyslog.conf.d/net-snmp.conf
%%NEWSYSLOG%%@dir etc/newsyslog.conf.d
%%NEWSYSLOG%%@sample %%DATADIR%%/newsyslog.conf.sample etc/newsyslog.conf.d/net-snmp.conf
include/net-snmp/agent/agent_callbacks.h
include/net-snmp/agent/agent_handler.h
include/net-snmp/agent/agent_index.h
@ -53,6 +59,7 @@ include/net-snmp/agent/mib_module_includes.h
include/net-snmp/agent/mib_modules.h
include/net-snmp/agent/mode_end_call.h
include/net-snmp/agent/multiplexer.h
include/net-snmp/agent/netsnmp_close_fds.h
include/net-snmp/agent/net-snmp-agent-includes.h
include/net-snmp/agent/null.h
include/net-snmp/agent/old_api.h
@ -110,6 +117,7 @@ include/net-snmp/library/lcd_time.h
include/net-snmp/library/md5.h
include/net-snmp/library/mib.h
include/net-snmp/library/mt_support.h
include/net-snmp/library/netsnmp-attribute-format.h
include/net-snmp/library/oid_stash.h
include/net-snmp/library/parse.h
include/net-snmp/library/read_config.h
@ -119,6 +127,7 @@ include/net-snmp/library/snmp.h
include/net-snmp/library/snmpAliasDomain.h
include/net-snmp/library/snmpCallbackDomain.h
%%TLS%%include/net-snmp/library/snmpDTLSUDPDomain.h
include/net-snmp/library/snmpIPBaseDomain.h
include/net-snmp/library/snmpTCPDomain.h
%%WITH_IPV6%%include/net-snmp/library/snmpTCPIPv6Domain.h
%%TLS%%include/net-snmp/library/snmpTLSBaseDomain.h
@ -177,6 +186,13 @@ include/net-snmp/system/darwin7.h
include/net-snmp/system/darwin8.h
include/net-snmp/system/darwin9.h
include/net-snmp/system/darwin10.h
include/net-snmp/system/darwin11.h
include/net-snmp/system/darwin12.h
include/net-snmp/system/darwin13.h
include/net-snmp/system/darwin14.h
include/net-snmp/system/darwin15.h
include/net-snmp/system/darwin16.h
include/net-snmp/system/darwin17.h
include/net-snmp/system/dragonfly.h
include/net-snmp/system/dynix.h
include/net-snmp/system/freebsd.h
@ -192,16 +208,20 @@ include/net-snmp/system/freebsd10.h
include/net-snmp/system/freebsd11.h
include/net-snmp/system/freebsd12.h
include/net-snmp/system/freebsd13.h
include/net-snmp/system/freebsd14.h
include/net-snmp/system/generic.h
include/net-snmp/system/hpux.h
include/net-snmp/system/irix.h
include/net-snmp/system/linux.h
include/net-snmp/system/mingw32.h
include/net-snmp/system/mingw32msvc.h
include/net-snmp/system/mips.h
include/net-snmp/system/netbsd.h
include/net-snmp/system/nto-qnx6.h
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/osf5.h
include/net-snmp/system/solaris.h
include/net-snmp/system/solaris2.3.h
@ -236,6 +256,8 @@ lib/libnetsnmptrapd.a
lib/libnetsnmptrapd.so
lib/libnetsnmptrapd.so.%%SHLIB_VERSION%%
lib/libnetsnmptrapd.so.%%SHLIB_VERSION%%%%SHLIB_VERSION2%%
libdata/pkgconfig/netsnmp-agent.pc
libdata/pkgconfig/netsnmp.pc
man/man1/agentxtrap.1.gz
man/man1/encode_keychange.1.gz
man/man1/fixproc.1.gz
@ -254,10 +276,12 @@ man/man1/snmpget.1.gz
man/man1/snmpgetnext.1.gz
man/man1/snmpinform.1.gz
man/man1/snmpnetstat.1.gz
man/man1/snmpps.1.gz
man/man1/snmpset.1.gz
man/man1/snmpstatus.1.gz
man/man1/snmptable.1.gz
man/man1/snmptest.1.gz
man/man1/snmptop.1.gz
man/man1/snmptranslate.1.gz
man/man1/snmptrap.1.gz
man/man1/snmpusm.1.gz
@ -376,7 +400,7 @@ man/man8/snmptrapd.8.gz
%%WITH_PERL%%man/man3/NetSNMP::default_store.3.gz
%%WITH_PERL%%man/man3/NetSNMP::netsnmp_request_infoPtr.3.gz
%%WITH_PERL%%man/man3/SNMP.3.gz
%%WITH_PERL%%%%SITE_ARCH%%/Bundle/Makefile.subs.pl
%%WITH_PERL%%%%SITE_ARCH%%/Bundle/MakefileSubs.pm
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/ASN.pm
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/OID.pm
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/TrapReceiver.pm
@ -431,6 +455,7 @@ sbin/snmptrapd
%%DATADIR%%/mib2c.mfd.conf
%%DATADIR%%/mib2c.notify.conf
%%DATADIR%%/mib2c.old-api.conf
%%DATADIR%%/mib2c.org-mode.conf
%%DATADIR%%/mib2c.perl.conf
%%DATADIR%%/mib2c.raw-table.conf
%%DATADIR%%/mib2c.scalar.conf
@ -553,6 +578,7 @@ sbin/snmptrapd
%%DATADIR%%/mibs/SNMP-USER-BASED-SM-MIB.txt
%%DATADIR%%/mibs/SNMP-USM-AES-MIB.txt
%%DATADIR%%/mibs/SNMP-USM-DH-OBJECTS-MIB.txt
%%DATADIR%%/mibs/SNMP-USM-HMAC-SHA2-MIB.txt
%%DATADIR%%/mibs/SNMP-VIEW-BASED-ACM-MIB.txt
%%DATADIR%%/mibs/SNMPv2-CONF.txt
%%DATADIR%%/mibs/SNMPv2-MIB.txt
@ -568,7 +594,7 @@ sbin/snmptrapd
%%DATADIR%%/mibs/UCD-IPFWACC-MIB.txt
%%DATADIR%%/mibs/UCD-SNMP-MIB.txt
%%DATADIR%%/mibs/UDP-MIB.txt
@unexec rm -f %D/%%DATADIR%%/mibs/.index 2>/dev/null || true
@postunexec rm -f %D/%%DATADIR%%/mibs/.index 2>/dev/null || true
%%WITH_PERL_EMBEDDED%%%%DATADIR%%/snmp_perl.pl
%%DATADIR%%/snmpconf-data/snmp-data/authopts
%%DATADIR%%/snmpconf-data/snmp-data/debugging