View | Details | Raw Unified | Return to bug 232025 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-35 / +27 lines)
Lines 2-9 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	snmp
4
PORTNAME=	snmp
5
PORTVERSION=	5.7.3
5
PORTVERSION=	5.8
6
PORTREVISION=	19
7
CATEGORIES=	net-mgmt ipv6
6
CATEGORIES=	net-mgmt ipv6
8
MASTER_SITES=	SF/net-${PORTNAME}/net-${PORTNAME}/${PORTVERSION} \
7
MASTER_SITES=	SF/net-${PORTNAME}/net-${PORTNAME}/${PORTVERSION} \
9
		ZI
8
		ZI
Lines 16-29 Link Here
16
LICENSE=	BSD3CLAUSE
15
LICENSE=	BSD3CLAUSE
17
LICENSE_FILE=	${WRKSRC}/COPYING
16
LICENSE_FILE=	${WRKSRC}/COPYING
18
17
19
BROKEN_SSL=	openssl111
20
21
LIB_DEPENDS=	libpkg.so:ports-mgmt/pkg
22
23
NOT_FOR_ARCHS=		mips mips64
18
NOT_FOR_ARCHS=		mips mips64
24
NOT_FOR_ARCHS_REASON=	SSP is currently broken on MIPS
19
NOT_FOR_ARCHS_REASON=	SSP is currently broken on MIPS
25
20
26
OPTIONS_DEFINE=	IPV6 MFD_REWRITES PERL PERL_EMBEDDED PYTHON DUMMY TKMIB \
21
LIB_DEPENDS=	libpkg.so:ports-mgmt/pkg \
22
		libpcre.so:devel/pcre
23
24
USES=		cpe libtool perl5 ssl
25
USE_RC_SUBR=	snmpd snmptrapd
26
USE_LDCONFIG=	yes
27
USE_PERL5=	build run
28
USE_CSTD=	c99
29
30
CPE_VENDOR=	net-snmp
31
GNU_CONFIGURE=	yes
32
33
OPTIONS_DEFINE=	MFD_REWRITES PERL PERL_EMBEDDED PYTHON DUMMY TKMIB \
27
		MYSQL AX_SOCKONLY UNPRIVILEGED SMUX DOCS JAIL AX_DISABLE_TRAP \
34
		MYSQL AX_SOCKONLY UNPRIVILEGED SMUX DOCS JAIL AX_DISABLE_TRAP \
28
		TLS NEWSYSLOG
35
		TLS NEWSYSLOG
29
OPTIONS_DEFAULT=PERL PERL_EMBEDDED DUMMY SMUX NEWSYSLOG
36
OPTIONS_DEFAULT=PERL PERL_EMBEDDED DUMMY SMUX NEWSYSLOG
Lines 44-57 Link Here
44
51
45
PORTSCOUT=	skipv:5.7.2.1
52
PORTSCOUT=	skipv:5.7.2.1
46
53
47
GNU_CONFIGURE=	yes
48
USE_RC_SUBR=	snmpd snmptrapd
49
USE_LDCONFIG=	yes
50
USES=		cpe libtool perl5 ssl
51
CPE_VENDOR=	net-snmp
52
USE_PERL5=	build run
53
USE_CSTD=	c99
54
55
CFLAGS+=	-I${LOCALBASE}/include -I${PKG_PREFIX}/include
54
CFLAGS+=	-I${LOCALBASE}/include -I${PKG_PREFIX}/include
56
LDFLAGS+=	-L${LOCALBASE}/lib
55
LDFLAGS+=	-L${LOCALBASE}/lib
57
CONFIGURE_ENV+=	PERLPROG="${PERL}" PSPROG="${PS_CMD}" SED="${SED}"
56
CONFIGURE_ENV+=	PERLPROG="${PERL}" PSPROG="${PS_CMD}" SED="${SED}"
Lines 77-86 Link Here
77
76
78
.include <bsd.port.options.mk>
77
.include <bsd.port.options.mk>
79
78
80
.if ${OSVERSION} >= 1200085
81
EXTRA_PATCHES=	${PATCHDIR}/extra-patch-openssl11
82
.endif
83
84
.if ${PORT_OPTIONS:MPYTHON}
79
.if ${PORT_OPTIONS:MPYTHON}
85
PYDISTUTILS_PKGNAME?=		netsnmp-python
80
PYDISTUTILS_PKGNAME?=		netsnmp-python
86
PYDISTUTILS_PKGVERSION?=	1.0a1
81
PYDISTUTILS_PKGVERSION?=	1.0a1
Lines 141-160 Link Here
141
CONFIGURE_ARGS+=--enable-agentx-dom-sock-only
136
CONFIGURE_ARGS+=--enable-agentx-dom-sock-only
142
.endif
137
.endif
143
138
144
.if ${PORT_OPTIONS:MIPV6}
145
CONFIGURE_ARGS+=--enable-ipv6
146
# --with-transport="UDPIPv6 TCPIPv6" --with-modules=mibII/ipv6"
147
PLIST_SUB+=	WITH_IPV6=""
148
.else
149
PLIST_SUB+=	WITH_IPV6="@comment "
150
.endif
151
152
.if ${PORT_OPTIONS:MUNPRIVILEGED}
139
.if ${PORT_OPTIONS:MUNPRIVILEGED}
153
CONFIGURE_ARGS+=--without-root-access
140
CONFIGURE_ARGS+=--without-root-access
154
.endif
141
.endif
155
142
156
SHLIB_VERSION=	30
143
SHLIB_VERSION=	35
157
SHLIB_VERSION2=	.0.3
144
SHLIB_VERSION2=	.0.0
158
PLIST_SUB+=	SHLIB_VERSION=${SHLIB_VERSION} SHLIB_VERSION2=${SHLIB_VERSION2}
145
PLIST_SUB+=	SHLIB_VERSION=${SHLIB_VERSION} SHLIB_VERSION2=${SHLIB_VERSION2}
159
SCRIPTS_SUB=	PREFIX=${PREFIX} PERL=${PERL}
146
SCRIPTS_SUB=	PREFIX=${PREFIX} PERL=${PERL}
160
147
Lines 199-205 Link Here
199
BIN_FILES=	snmpbulkwalk snmpget snmpgetnext snmpset \
186
BIN_FILES=	snmpbulkwalk snmpget snmpgetnext snmpset \
200
		snmpstatus snmptest snmptranslate snmptrap snmpwalk \
187
		snmpstatus snmptest snmptranslate snmptrap snmpwalk \
201
		snmptable snmpbulkget snmpdelta snmpdf agentxtrap \
188
		snmptable snmpbulkget snmpdelta snmpdf agentxtrap \
202
		snmpvacm snmpusm encode_keychange snmpnetstat
189
		snmpvacm snmpusm encode_keychange snmpnetstat \
190
		snmppcap snmpping snmpps
191
.if ${PORT_OPTIONS:MTLS}
192
BIN_FILES+=	snmptls
193
.endif
194
203
LIB_FILES=	libnetsnmp.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
195
LIB_FILES=	libnetsnmp.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
204
		libnetsnmpagent.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
196
		libnetsnmpagent.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
205
		libnetsnmpmibs.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
197
		libnetsnmpmibs.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
Lines 246-258 Link Here
246
238
247
post-patch:
239
post-patch:
248
.for filename in ${SCRIPT_FILES}
240
.for filename in ${SCRIPT_FILES}
249
	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/local/${filename}
241
	${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/local/${filename}
250
.endfor
242
.endfor
251
	@${REINPLACE_CMD} -e 's!utmp_p->ut_name!utmp_p->ut_user!' \
243
	${REINPLACE_CMD} -e 's!utmp_p->ut_name!utmp_p->ut_user!' \
252
	    ${WRKSRC}/agent/mibgroup/host/hr_system.c
244
	    ${WRKSRC}/agent/mibgroup/host/hr_system.c
253
	@${REINPLACE_CMD} -E -e 's|return pci_lookup_name|disabled broken|g' \
245
	${REINPLACE_CMD} -E -e 's|return pci_lookup_name|disabled broken|g' \
254
		${WRKSRC}/configure
246
		${WRKSRC}/configure
255
	@${CP} ${WRKSRC}/include/net-snmp/system/freebsd12.h \
247
	${CP} ${WRKSRC}/include/net-snmp/system/freebsd12.h \
256
		${WRKSRC}/include/net-snmp/system/freebsd13.h
248
		${WRKSRC}/include/net-snmp/system/freebsd13.h
257
249
258
post-configure:
250
post-configure:
Lines 306-312 Link Here
306
298
307
install-doc-files:
299
install-doc-files:
308
.if ${PORT_OPTIONS:MDOCS}
300
.if ${PORT_OPTIONS:MDOCS}
309
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
301
	${MKDIR} ${STAGEDIR}${DOCSDIR}
310
. for filename in ${DOC_FILES}
302
. for filename in ${DOC_FILES}
311
	${INSTALL_DATA} ${WRKSRC}/${filename} ${STAGEDIR}${DOCSDIR}
303
	${INSTALL_DATA} ${WRKSRC}/${filename} ${STAGEDIR}${DOCSDIR}
312
. endfor
304
. endfor
(-)distinfo (-2 / +3 lines)
Lines 1-2 Link Here
1
SHA256 (net-snmp-5.7.3.tar.gz) = 12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0
1
TIMESTAMP = 1538855962
2
SIZE (net-snmp-5.7.3.tar.gz) = 6382428
2
SHA256 (net-snmp-5.8.tar.gz) = b2fc3500840ebe532734c4786b0da4ef0a5f67e51ef4c86b3345d697e4976adf
3
SIZE (net-snmp-5.8.tar.gz) = 6591680
(-)files/extra-patch-local_Makefile.in (-4 / +4 lines)
Lines 1-11 Link Here
1
--- local/Makefile.in.orig	2015-01-19 14:37:56 UTC
1
--- local/Makefile.in.orig	2018-07-16 14:33:40 UTC
2
+++ local/Makefile.in
2
+++ local/Makefile.in
3
@@ -16,7 +16,7 @@ OTHERUNINSTALL=localuninstall
3
@@ -14,7 +14,7 @@ OTHERUNINSTALL=localuninstall
4
 #
4
 #
5
 SNMPCONFPATH=@SNMPCONFPATH@
5
 SNMPCONFPATH=@SNMPCONFPATH@
6
 PERSISTENT_DIRECTORY=@PERSISTENT_DIRECTORY@
6
 PERSISTENT_DIRECTORY=@PERSISTENT_DIRECTORY@
7
-PERLSCRIPTS=snmpcheck tkmib mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert
7
-PERLSCRIPTS=snmpcheck tkmib mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert checkbandwidth
8
+PERLSCRIPTS=snmpcheck mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert
8
+PERLSCRIPTS=snmpcheck mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert checkbandwidth
9
 SHELLSCRIPTS=mib2c-update
9
 SHELLSCRIPTS=mib2c-update
10
 SCRIPTSMADEFORPERL=snmpcheck.made tkmib.made mib2c.made fixproc.made \
10
 SCRIPTSMADEFORPERL=snmpcheck.made tkmib.made mib2c.made fixproc.made \
11
 	ipf-mod.pl.made snmpconf.made traptoemail.made snmp-bridge-mib.made \
11
 	ipf-mod.pl.made snmpconf.made traptoemail.made snmp-bridge-mib.made \
(-)files/patch-Makefile.in (-10 / +10 lines)
Lines 1-19 Link Here
1
--- Makefile.in.orig	2014-12-08 20:23:22 UTC
1
--- Makefile.in.orig	2018-07-16 14:33:40 UTC
2
+++ Makefile.in
2
+++ Makefile.in
3
@@ -21,7 +21,7 @@ INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi
3
@@ -22,7 +22,7 @@ INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi
4
 	darwin.h darwin7.h darwin8.h darwin9.h darwin10.h dragonfly.h dynix.h \
4
 	dragonfly.h dynix.h \
5
 	freebsd2.h freebsd3.h freebsd4.h freebsd5.h freebsd6.h \
5
 	freebsd2.h freebsd3.h freebsd4.h freebsd5.h freebsd6.h \
6
 	freebsd7.h freebsd8.h freebsd9.h freebsd10.h freebsd11.h \
6
 	freebsd7.h freebsd8.h freebsd9.h freebsd10.h freebsd11.h \
7
-	freebsd12.h freebsd.h \
7
-	freebsd12.h freebsd.h kfreebsd.h \
8
+	freebsd12.h freebsd13.h freebsd.h \
8
+	freebsd12.h freebsd13.h freebsd.h kfreebsd.h \
9
         generic.h \
9
 	generic.h \
10
 	hpux.h irix.h linux.h mingw32.h mips.h netbsd.h osf5.h \
10
 	hpux.h irix.h linux.h mingw32.h mingw32msvc.h mips.h \
11
 	openbsd.h openbsd5.h openbsd4.h \
11
 	netbsd.h nto-qnx6.h osf5.h \
12
@@ -230,7 +230,7 @@ pythonmodules: subdirs
12
@@ -234,7 +234,7 @@ pythonmodules: subdirs
13
         fi
13
         fi
14
 
14
 
15
 pythoninstall:
15
 pythoninstall:
16
-	@(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir) ; \
16
-	@(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir --root=$(DESTDIR) --prefix=$(prefix)) ; \
17
+	@(dir=`pwd`; cd python; $(PYMAKE) install --root=${STAGEDIR} --basedir=$$dir ${PYDISTUTILS_INSTALLARGS}) ; \
17
+	@(dir=`pwd`; cd python; $(PYMAKE) install --root=${STAGEDIR} --basedir=$$dir ${PYDISTUTILS_INSTALLARGS}) ; \
18
         if test $$? != 0 ; then \
18
         if test $$? != 0 ; then \
19
            exit 1 ; \
19
            exit 1 ; \
(-)files/patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c (-4 / +4 lines)
Lines 1-6 Link Here
1
--- agent/mibgroup/hardware/cpu/cpu_sysctl.c.orig	2014-12-08 12:23:22.000000000 -0800
1
--- agent/mibgroup/hardware/cpu/cpu_sysctl.c.orig	2018-07-16 14:33:40 UTC
2
+++ agent/mibgroup/hardware/cpu/cpu_sysctl.c	2017-04-20 15:05:11.607496000 -0700
2
+++ agent/mibgroup/hardware/cpu/cpu_sysctl.c
3
@@ -130,8 +130,21 @@
3
@@ -133,8 +133,21 @@ void init_cpu_sysctl( void ) {
4
 #endif  /* VM_UVMEXP2 || VM_UVMEXP */
4
 #endif  /* VM_UVMEXP2 || VM_UVMEXP */
5
 
5
 
6
 #elif defined(__FreeBSD__)                /* FreeBSD */
6
 #elif defined(__FreeBSD__)                /* FreeBSD */
Lines 23-29 Link Here
23
     #define NS_VM_INTR		v_intr
23
     #define NS_VM_INTR		v_intr
24
     #define NS_VM_SWTCH		v_swtch
24
     #define NS_VM_SWTCH		v_swtch
25
     #define NS_VM_PAGEIN	v_swappgsin
25
     #define NS_VM_PAGEIN	v_swappgsin
26
@@ -206,7 +219,23 @@
26
@@ -209,7 +222,23 @@ int netsnmp_cpu_arch_load( netsnmp_cache *cache, void 
27
          * Interrupt/Context Switch statistics
27
          * Interrupt/Context Switch statistics
28
          *   XXX - Do these really belong here ?
28
          *   XXX - Do these really belong here ?
29
          */
29
          */
(-)files/patch-agent_mibgroup_hardware_cpu_cpu_sysctl.c (-49 lines)
Lines 1-49 Link Here
1
--- agent/mibgroup/hardware/cpu/cpu_sysctl.c.orig	2014-12-08 12:23:22.000000000 -0800
2
+++ agent/mibgroup/hardware/cpu/cpu_sysctl.c	2017-04-20 15:05:11.607496000 -0700
3
@@ -130,8 +130,21 @@
4
 #endif  /* VM_UVMEXP2 || VM_UVMEXP */
5
 
6
 #elif defined(__FreeBSD__)                /* FreeBSD */
7
+#if __FreeBSD_version >= 1200028
8
+#define	VMMETER_TYPE	uint64_t
9
+#else
10
+#define	VMMETER_TYPE	u_int
11
+#endif
12
+struct __vmmeter {
13
+	VMMETER_TYPE	v_intr;
14
+	VMMETER_TYPE	v_swtch;
15
+	VMMETER_TYPE	v_swappgsin;
16
+	VMMETER_TYPE	v_swappgsout;
17
+	VMMETER_TYPE	v_swapin;
18
+	VMMETER_TYPE	v_swapout;
19
+};
20
 #define NETSNMP_VM_STATS       VM_METER
21
-#define NETSNMP_VM_STATS_TYPE  struct vmmeter
22
+#define NETSNMP_VM_STATS_TYPE  struct __vmmeter
23
     #define NS_VM_INTR		v_intr
24
     #define NS_VM_SWTCH		v_swtch
25
     #define NS_VM_PAGEIN	v_swappgsin
26
@@ -206,7 +219,23 @@
27
          * Interrupt/Context Switch statistics
28
          *   XXX - Do these really belong here ?
29
          */
30
+#ifdef __FreeBSD__
31
+#define	GET_VM_STATS(space, name) sysctlbyname("vm.stats." #space "." #name, &mem_stats.name, &len, NULL, 0)
32
+    {
33
+	size_t len;
34
+
35
+	len = sizeof(VMMETER_TYPE);
36
+	GET_VM_STATS(sys, v_intr);
37
+	GET_VM_STATS(sys, v_swtch);
38
+	GET_VM_STATS(vm, v_swappgsin);
39
+	GET_VM_STATS(vm, v_swappgsout);
40
+	GET_VM_STATS(vm, v_swapin);
41
+	GET_VM_STATS(vm, v_swapout);
42
+    }
43
+#undef GET_VM_STATS
44
+#else
45
     sysctl(mem_mib, 2, &mem_stats, &mem_size, NULL, 0);
46
+#endif
47
     cpu->nInterrupts  = mem_stats.NS_VM_INTR;
48
     cpu->nCtxSwitches = mem_stats.NS_VM_SWTCH;
49
     cpu->swapIn       = mem_stats.NS_VM_SWAPIN;
(-)files/patch-agent_mibgroup_hardware_fsys_fsys__getfsstats.c (-11 lines)
Lines 1-11 Link Here
1
--- agent/mibgroup/hardware/fsys/fsys_getfsstats.c.orig	2017-03-22 16:28:29 UTC
2
+++ agent/mibgroup/hardware/fsys/fsys_getfsstats.c
3
@@ -116,7 +116,7 @@ netsnmp_fsys_arch_load( void )
4
     /*
5
      * Retrieve information about the currently mounted filesystems...
6
      */
7
-    n = NSFS_GETFSSTAT( NULL, 0, 0 );
8
+    n = NSFS_GETFSSTAT( NULL, 0, MNT_NOWAIT );
9
     if ( n==0 )
10
         return;
11
     stats = (struct NSFS_STATFS *)malloc( n * sizeof( struct NSFS_STATFS ));
(-)files/patch-agent_mibgroup_hardware_memory_memory__freebsd.c (-2 / +2 lines)
Lines 1-6 Link Here
1
--- agent/mibgroup/hardware/memory/memory_freebsd.c.orig	2015-02-20 14:44:47 UTC
1
--- agent/mibgroup/hardware/memory/memory_freebsd.c.orig	2018-07-16 14:33:40 UTC
2
+++ agent/mibgroup/hardware/memory/memory_freebsd.c
2
+++ agent/mibgroup/hardware/memory/memory_freebsd.c
3
@@ -163,7 +163,7 @@ int netsnmp_mem_arch_load( netsnmp_cache
3
@@ -163,7 +163,7 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void 
4
         if (!mem->descr)
4
         if (!mem->descr)
5
              mem->descr = strdup("Cached memory");
5
              mem->descr = strdup("Cached memory");
6
         mem->units = pagesize;
6
         mem->units = pagesize;
(-)files/patch-agent_mibgroup_mibII_icmp.h (-12 lines)
Lines 1-12 Link Here
1
--- agent/mibgroup/mibII/icmp.h.orig	2014-12-08 20:23:22 UTC
2
+++ agent/mibgroup/mibII/icmp.h
3
@@ -14,6 +14,9 @@ config_arch_require(freebsd7,  mibII/ker
4
 config_arch_require(freebsd8,  mibII/kernel_sysctl)
5
 config_arch_require(freebsd9,  mibII/kernel_sysctl)
6
 config_arch_require(freebsd10, mibII/kernel_sysctl)
7
+config_arch_require(freebsd11, mibII/kernel_sysctl)
8
+config_arch_require(freebsd12, mibII/kernel_sysctl)
9
+config_arch_require(freebsd13, mibII/kernel_sysctl)
10
 config_arch_require(netbsd,    mibII/kernel_netbsd)
11
 config_arch_require(netbsdelf, mibII/kernel_netbsd)
12
 config_arch_require(openbsd4,  mibII/kernel_sysctl)
(-)files/patch-agent_mibgroup_mibII_tcpTable.c (-7 / +7 lines)
Lines 1-6 Link Here
1
--- agent/mibgroup/mibII/tcpTable.c.orig	2017-03-15 17:46:37.000000000 +0000
1
--- agent/mibgroup/mibII/tcpTable.c.orig	2018-07-16 14:33:40 UTC
2
+++ agent/mibgroup/mibII/tcpTable.c	2017-03-15 17:46:37.000000000 +0000
2
+++ agent/mibgroup/mibII/tcpTable.c
3
@@ -96,7 +96,11 @@
3
@@ -120,7 +120,11 @@ struct netsnmp_tcpConnEntry_s {
4
 
4
 
5
 typedef struct netsnmp_inpcb_s netsnmp_inpcb;
5
 typedef struct netsnmp_inpcb_s netsnmp_inpcb;
6
 struct netsnmp_inpcb_s {
6
 struct netsnmp_inpcb_s {
Lines 12-18 Link Here
12
     int             state;
12
     int             state;
13
     netsnmp_inpcb  *inp_next;
13
     netsnmp_inpcb  *inp_next;
14
 };
14
 };
15
@@ -301,8 +305,10 @@
15
@@ -330,8 +334,10 @@ tcpTable_handler(netsnmp_mib_handler          *handler
16
 #ifndef NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS
16
 #ifndef NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS
17
 int
17
 int
18
 TCP_Count_Connections( void ) {
18
 TCP_Count_Connections( void ) {
Lines 23-29 Link Here
23
 }
23
 }
24
 #endif /* NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS */
24
 #endif /* NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS */
25
 
25
 
26
@@ -923,12 +929,20 @@
26
@@ -988,12 +994,20 @@ tcpTable_load(netsnmp_cache *cache, void *vmagic)
27
         nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
27
         nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
28
         if (!nnew)
28
         if (!nnew)
29
             break;
29
             break;
Lines 42-46 Link Here
42
                            sizeof(struct inpcb));
42
                            sizeof(struct inpcb));
43
+#endif
43
+#endif
44
 
44
 
45
 	if (nnew->pcb.inp_vflag & INP_IPV6)
45
 #ifdef INP_ISIPV6
46
 	    free(nnew);
46
 	if (INP_ISIPV6(&nnew->pcb))
(-)files/patch-agent_mibgroup_mibII_udpTable.c (-4 / +4 lines)
Lines 1-6 Link Here
1
--- agent/mibgroup/mibII/udpTable.c.orig	2017-03-15 18:08:43.000000000 +0000
1
--- agent/mibgroup/mibII/udpTable.c.orig	2018-07-16 14:33:40 UTC
2
+++ agent/mibgroup/mibII/udpTable.c	2017-03-15 18:08:43.000000000 +0000
2
+++ agent/mibgroup/mibII/udpTable.c
3
@@ -71,7 +71,11 @@
3
@@ -97,7 +97,11 @@ struct netsnmp_udpEntry_s {
4
 #if defined(freebsd4) || defined(darwin) || defined(osf5)
4
 #if defined(freebsd4) || defined(darwin) || defined(osf5)
5
 typedef struct netsnmp_inpcb_s netsnmp_inpcb;
5
 typedef struct netsnmp_inpcb_s netsnmp_inpcb;
6
 struct netsnmp_inpcb_s {
6
 struct netsnmp_inpcb_s {
Lines 12-18 Link Here
12
     int             state;
12
     int             state;
13
     netsnmp_inpcb  *inp_next;
13
     netsnmp_inpcb  *inp_next;
14
 };
14
 };
15
@@ -670,7 +674,11 @@
15
@@ -708,7 +712,11 @@ udpTable_load(netsnmp_cache *cache, void *vmagic)
16
         nnew = SNMP_MALLOC_TYPEDEF(UDPTABLE_ENTRY_TYPE);
16
         nnew = SNMP_MALLOC_TYPEDEF(UDPTABLE_ENTRY_TYPE);
17
         if (!nnew)
17
         if (!nnew)
18
             break;
18
             break;
(-)files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c (-6 / +6 lines)
Lines 1-6 Link Here
1
--- agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c.orig	2017-03-15 18:15:07.000000000 +0000
1
--- agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c.orig	2018-07-16 14:33:40 UTC
2
+++ agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c	2017-03-15 18:15:07.000000000 +0000
2
+++ agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c
3
@@ -163,7 +163,11 @@
3
@@ -163,7 +163,11 @@ _load(netsnmp_container *container, u_int load_flags)
4
 #else
4
 #else
5
 	xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
5
 	xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
6
 #endif
6
 #endif
Lines 12-18 Link Here
12
 
12
 
13
 	if (load_flags) {
13
 	if (load_flags) {
14
 	    if (state == TCPCONNECTIONSTATE_LISTEN) {
14
 	    if (state == TCPCONNECTIONSTATE_LISTEN) {
15
@@ -215,6 +219,8 @@
15
@@ -223,6 +227,8 @@ _load(netsnmp_container *container, u_int load_flags)
16
         entry->arbitrary_index = CONTAINER_SIZE(container) + 1;
16
         entry->arbitrary_index = CONTAINER_SIZE(container) + 1;
17
         CONTAINER_INSERT(container, entry);
17
         CONTAINER_INSERT(container, entry);
18
     }
18
     }
Lines 19-23 Link Here
19
+
19
+
20
+    free(tcpcb_buf);
20
+    free(tcpcb_buf);
21
 
21
 
22
     if(rc<0)
22
     free(tcpcb_buf);
23
         return rc;
23
 
(-)files/patch-agent_mibgroup_ucd-snmp_diskio.c (-54 lines)
Lines 1-54 Link Here
1
--- agent/mibgroup/ucd-snmp/diskio.c.orig	2014-12-08 20:23:22 UTC
2
+++ agent/mibgroup/ucd-snmp/diskio.c
3
@@ -944,14 +944,14 @@ var_diskio(struct variable * vp,
4
         return (u_char *) stat->dinfo->devices[indx].device_name;
5
     case DISKIO_NREAD:
6
 #if HAVE_DEVSTAT_GETDEVS
7
-        long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_READ];
8
+        long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_READ] & 0xFFFFFFFF;
9
 #else
10
         long_ret = (signed long) stat->dinfo->devices[indx].bytes_read;
11
 #endif
12
         return (u_char *) & long_ret;
13
     case DISKIO_NWRITTEN:
14
 #if HAVE_DEVSTAT_GETDEVS
15
-        long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE];
16
+        long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE] & 0xFFFFFFFF;
17
 #else
18
         long_ret = (signed long) stat->dinfo->devices[indx].bytes_written;
19
 #endif
20
@@ -959,7 +959,7 @@ var_diskio(struct variable * vp,
21
     case DISKIO_NREADX:
22
         *var_len = sizeof(struct counter64);
23
 #if HAVE_DEVSTAT_GETDEVS
24
-        longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_READ];
25
+        longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_READ] & 0xFFFFFFFF;
26
 #else
27
         longlong_ret = stat->dinfo->devices[indx].bytes_read;
28
 #endif
29
@@ -969,7 +969,7 @@ var_diskio(struct variable * vp,
30
     case DISKIO_NWRITTENX:
31
         *var_len = sizeof(struct counter64);
32
 #if HAVE_DEVSTAT_GETDEVS
33
-        longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE];
34
+        longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE] & 0xFFFFFFFF;
35
 #else
36
         longlong_ret = stat->dinfo->devices[indx].bytes_written;
37
 #endif
38
@@ -978,14 +978,14 @@ var_diskio(struct variable * vp,
39
         return (u_char *) & c64_ret;
40
     case DISKIO_READS:
41
 #if HAVE_DEVSTAT_GETDEVS
42
-        long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_READ];
43
+        long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_READ] & 0xFFFFFFFF;
44
 #else
45
         long_ret = (signed long) stat->dinfo->devices[indx].num_reads;
46
 #endif
47
         return (u_char *) & long_ret;
48
     case DISKIO_WRITES:
49
 #if HAVE_DEVSTAT_GETDEVS
50
-        long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_WRITE];
51
+        long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_WRITE] & 0xFFFFFFFF;
52
 #else
53
         long_ret = (signed long) stat->dinfo->devices[indx].num_writes;
54
 #endif
(-)files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c (-22 / +10 lines)
Lines 1-18 Link Here
1
--- agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c.orig	2014-12-08 12:23:22.000000000 -0800
1
--- agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c.orig	2018-07-16 14:33:40 UTC
2
+++ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c	2017-04-07 16:05:05.752849000 -0700
2
+++ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c
3
@@ -153,7 +153,11 @@
3
@@ -168,9 +168,24 @@ _load(netsnmp_container *container, u_int load_flags)
4
 #endif
5
 
6
 #if !defined(NETSNMP_ENABLE_IPV6)
7
+#if __FreeBSD_version >= 1200026
8
+	if (pcb.inp_vflag & INP_IPV6)
9
+#else
10
         if (pcb.xi_inp.inp_vflag & INP_IPV6)
11
+#endif
12
 	    continue;
13
 #endif
14
 
15
@@ -164,9 +168,24 @@
16
         }
4
         }
17
 
5
 
18
         /** oddly enough, these appear to already be in network order */
6
         /** oddly enough, these appear to already be in network order */
Lines 37-44 Link Here
37
-        entry->pid = 0;
25
-        entry->pid = 0;
38
         
26
         
39
         /** the addr string may need work */
27
         /** the addr string may need work */
40
 	if (pcb.xi_inp.inp_vflag & INP_IPV6) {
28
 #ifdef INP_ISIPV6
41
@@ -179,6 +198,8 @@
29
@@ -187,6 +202,8 @@ _load(netsnmp_container *container, u_int load_flags)
42
 	    memcpy(entry->loc_addr, &pcb.xi_inp.inp_laddr, 4);
30
 	    memcpy(entry->loc_addr, &pcb.xi_inp.inp_laddr, 4);
43
 	    memcpy(entry->rmt_addr, &pcb.xi_inp.inp_faddr, 4);
31
 	    memcpy(entry->rmt_addr, &pcb.xi_inp.inp_faddr, 4);
44
 	}
32
 	}
Lines 47-58 Link Here
47
 
35
 
48
         /*
36
         /*
49
          * add entry to container
37
          * add entry to container
50
@@ -187,6 +208,8 @@
38
@@ -194,6 +211,8 @@ _load(netsnmp_container *container, u_int load_flags)
39
 	entry->index = CONTAINER_SIZE(container) + 1;
51
         CONTAINER_INSERT(container, entry);
40
         CONTAINER_INSERT(container, entry);
52
     }
41
     }
53
 
42
+
54
+    free(udpcb_buf);
43
+    free(udpcb_buf);
55
+
56
     if(rc<0)
57
         return rc;
58
 
44
 
45
     free(udpcb_buf);
46
 
(-)files/patch-include__net-snmp__net-snmp-config.h.in (-11 lines)
Lines 1-11 Link Here
1
--- ./include/net-snmp/net-snmp-config.h.in.orig	2012-10-09 18:28:58.000000000 -0400
2
+++ ./include/net-snmp/net-snmp-config.h.in	2012-10-14 11:37:35.000000000 -0400
3
@@ -2106,7 +2106,7 @@
4
 #define UCD_SNMP_LIBRARY 1
5
 
6
 /* final conclusion on nlist usage */
7
-#if defined(HAVE_NLIST) && defined(HAVE_STRUCT_NLIST_N_VALUE) && !defined(NETSNMP_DONT_USE_NLIST) && defined(HAVE_KMEM) && !defined(NETSNMP_NO_KMEM_USAGE)
8
+#if defined(HAVE_NLIST) && defined(HAVE_STRUCT_NLIST_N_VALUE) && !defined(NETSNMP_DONT_USE_NLIST) && !defined(NETSNMP_NO_KMEM_USAGE)
9
 #define NETSNMP_CAN_USE_NLIST
10
 #endif
11
 
(-)files/patch-include_net-snmp_library_transform__oids.h (-7 / +7 lines)
Lines 1-11 Link Here
1
--- include/net-snmp/library/transform_oids.h.orig	2006-10-28 05:19:44.000000000 +0900
1
--- include/net-snmp/library/transform_oids.h.orig	2018-07-16 14:33:40 UTC
2
+++ include/net-snmp/library/transform_oids.h	2008-03-26 07:50:45.393507729 +0900
2
+++ include/net-snmp/library/transform_oids.h
3
@@ -23,6 +23,8 @@
3
@@ -48,6 +48,8 @@ NETSNMP_IMPORT oid      usmDESPrivProtocol[10];
4
 /* XXX: OIDs not defined yet */
4
 
5
 NETSNMP_IMPORT oid      usmAESPrivProtocol[10]; /* == { 1,3,6,1,6,3,10,1,2,4 }; */
5
 NETSNMP_IMPORT oid      usmAESPrivProtocol[10];
6
 NETSNMP_IMPORT oid      *usmAES128PrivProtocol; /* backwards compat */
6
 NETSNMP_IMPORT oid      *usmAES128PrivProtocol; /* backwards compat */
7
+NETSNMP_IMPORT oid      *usmAES192PrivProtocol; /* backwards compat */
7
+NETSNMP_IMPORT oid      *usmAES192PrivProtocol; /* backwards compat */
8
+NETSNMP_IMPORT oid      *usmAES256PrivProtocol; /* backwards compat */
8
+NETSNMP_IMPORT oid      *usmAES256PrivProtocol; /* backwards compat */
9
 
9
 
10
 #define USM_AUTH_PROTO_NOAUTH_LEN 10
10
 /*
11
 #define USM_AUTH_PROTO_MD5_LEN 10
11
  * backwards compatibility. should not be used in internal code.
(-)files/patch-include_net-snmp_system_freebsd13.h (-4 / +4 lines)
Lines 1-6 Link Here
1
--- include/net-snmp/system/freebsd13.h.orig	2018-12-25 15:35:28 UTC
1
--- include/net-snmp/system/freebsd13.h.orig	2019-03-07 15:59:25 UTC
2
+++ include/net-snmp/system/freebsd13.h
2
+++ include/net-snmp/system/freebsd13.h
3
@@ -0,0 +1,3 @@
3
@@ -0,0 +1,3 @@
4
+/* freebsd13 is a superset of freebsd12 */
4
+/* freebsd12 is a superset of freebsd11 */
5
+#include "freebsd12.h"
5
+#include "freebsd11.h"
6
+#define freebsd13 freebsd13
6
+#define freebsd11 freebsd11
(-)files/patch-kthreads (-96 lines)
Lines 1-96 Link Here
1
diff --git a/agent/mibgroup/host/data_access/swrun.c b/agent/mibgroup/host/data_access/swrun.c
2
index d18ea5f..60ad5b4 100644
3
--- agent/mibgroup/host/data_access/swrun.c
4
+++ agent/mibgroup/host/data_access/swrun.c
5
@@ -75,10 +75,27 @@ shutdown_swrun(void)
6
 }
7
 
8
 int
9
-swrun_count_processes( void )
10
+swrun_count_processes(int include_kthreads)
11
 {
12
+    netsnmp_swrun_entry *entry;
13
+    netsnmp_iterator  *it;
14
+    int i = 0;
15
+
16
     netsnmp_cache_check_and_reload(swrun_cache);
17
-    return ( swrun_container ? CONTAINER_SIZE(swrun_container) : 0 );
18
+    if ( !swrun_container )
19
+        return 0;    /* or -1 */
20
+
21
+    if (include_kthreads)
22
+	return ( swrun_container ? CONTAINER_SIZE(swrun_container) : 0 );
23
+
24
+    it = CONTAINER_ITERATOR( swrun_container );
25
+    while ((entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) != NULL) {
26
+        if (4 == entry->hrSWRunType)
27
+            i++;
28
+    }
29
+    ITERATOR_RELEASE( it );
30
+
31
+    return i;
32
 }
33
 
34
 #ifndef NETSNMP_FEATURE_REMOVE_SWRUN_MAX_PROCESSES
35
diff --git a/agent/mibgroup/host/hr_system.c b/agent/mibgroup/host/hr_system.c
36
index d99cc7d..e853779 100644
37
--- agent/mibgroup/host/hr_system.c
38
+++ agent/mibgroup/host/hr_system.c
39
@@ -24,6 +24,7 @@
40
 
41
 #include <net-snmp/net-snmp-includes.h>
42
 #include <net-snmp/agent/net-snmp-agent-includes.h>
43
+#include <net-snmp/data_access/swrun.h>
44
 
45
 #include "host.h"
46
 #include "host_res.h"
47
@@ -114,7 +115,14 @@ static long     get_max_solaris_processes(void);
48
 static int      get_load_dev(void);
49
 static int      count_users(void);
50
 extern int      count_processes(void);
51
-extern int      swrun_count_processes(void);
52
+#if USING_HOST_DATA_ACCESS_SWRUN_MODULE
53
+static int      count_kthreads = 0;
54
+
55
+static void parse_count_kthreads(const char *token, const char *line)
56
+{
57
+    count_kthreads = atoi(line);
58
+}
59
+#endif
60
 
61
         /*********************
62
 	 *
63
@@ -194,6 +202,11 @@ init_hr_system(void)
64
 #ifdef NPROC_SYMBOL
65
     auto_nlist(NPROC_SYMBOL, 0, 0);
66
 #endif
67
+#if USING_HOST_DATA_ACCESS_SWRUN_MODULE
68
+    snmpd_register_const_config_handler("count_kthreads",
69
+                                        parse_count_kthreads, NULL,
70
+					"0|1    0 to exclude kernel threads from hrSystemProcesses.0");
71
+#endif
72
 
73
     REGISTER_MIB("host/hr_system", hrsystem_variables, variable2,
74
                  hrsystem_variables_oid);
75
@@ -317,7 +330,7 @@ var_hrsys(struct variable * vp,
76
         return (u_char *) & long_return;
77
     case HRSYS_PROCS:
78
 #if USING_HOST_DATA_ACCESS_SWRUN_MODULE
79
-        long_return = swrun_count_processes();
80
+        long_return = swrun_count_processes(count_kthreads);
81
 #elif USING_HOST_HR_SWRUN_MODULE
82
         long_return = count_processes();
83
 #else
84
diff --git a/include/net-snmp/data_access/swrun.h b/include/net-snmp/data_access/swrun.h
85
index 3e15c41..4f768ac 100644
86
--- include/net-snmp/data_access/swrun.h
87
+++ include/net-snmp/data_access/swrun.h
88
@@ -85,7 +85,7 @@ extern "C" {
89
 
90
     void netsnmp_swrun_entry_free(netsnmp_swrun_entry *entry);
91
 
92
-    int  swrun_count_processes( void );
93
+    int  swrun_count_processes( int include_kthreads );
94
     int  swrun_max_processes(   void );
95
     int  swrun_count_processes_by_name( char *name );
96
 
(-)files/patch-perl5.23 (-135 lines)
Lines 1-135 Link Here
1
--- agent/snmp_perl.c.orig	2015-08-11 13:07:06 UTC
2
+++ agent/snmp_perl.c
3
@@ -5,6 +5,10 @@
4
 #include <EXTERN.h>
5
 #include "perl.h"
6
 
7
+#ifdef U64TYPE
8
+#define U64 U64pairU32
9
+#endif
10
+
11
 #include <net-snmp/net-snmp-config.h>
12
 #include <net-snmp/net-snmp-includes.h>
13
 #include <net-snmp/agent/net-snmp-agent-includes.h>
14
--- perl/OID/OID.xs.orig	2015-08-11 13:07:28 UTC
15
+++ perl/OID/OID.xs
16
@@ -7,6 +7,10 @@
17
 #include "perl.h"
18
 #include "XSUB.h"
19
 
20
+#ifdef U64TYPE
21
+#define U64 U64pairU32
22
+#endif
23
+
24
 #include <net-snmp/net-snmp-config.h>
25
 #include <net-snmp/net-snmp-includes.h>
26
 
27
--- perl/SNMP/SNMP.xs.orig	2015-08-11 13:07:54 UTC
28
+++ perl/SNMP/SNMP.xs
29
@@ -16,6 +16,10 @@
30
 #include "perl.h"
31
 #include "XSUB.h"
32
 
33
+#ifdef U64TYPE
34
+#define U64 U64pairU32
35
+#endif
36
+
37
 #include <net-snmp/net-snmp-config.h>
38
 #include <net-snmp/net-snmp-includes.h>
39
 #include <sys/types.h>
40
--- perl/TrapReceiver/TrapReceiver.xs.orig	2015-08-11 13:08:02 UTC
41
+++ perl/TrapReceiver/TrapReceiver.xs
42
@@ -9,6 +9,10 @@
43
 
44
 #include "ppport.h"
45
 
46
+#ifdef U64TYPE
47
+#define U64 U64pairU32
48
+#endif
49
+
50
 #include <net-snmp/net-snmp-config.h>
51
 #include <net-snmp/net-snmp-includes.h>
52
 #include <net-snmp/agent/net-snmp-agent-includes.h>
53
--- perl/agent/agent.xs.orig	2015-08-11 13:07:48 UTC
54
+++ perl/agent/agent.xs
55
@@ -9,6 +9,10 @@
56
 #include <netdb.h>
57
 #include <sys/socket.h>
58
 
59
+#ifdef U64TYPE
60
+#define U64 U64pairU32
61
+#endif
62
+
63
 #include <net-snmp/net-snmp-config.h>
64
 #include <net-snmp/net-snmp-includes.h>
65
 #include <net-snmp/agent/net-snmp-agent-includes.h>
66
--- perl/ASN/Makefile.PL.orig	2014-12-08 20:23:22 UTC
67
+++ perl/ASN/Makefile.PL
68
@@ -1,3 +1,4 @@
69
+package ASN;
70
 use ExtUtils::MakeMaker;
71
 require 5;
72
 use Config;
73
--- perl/AnyData_SNMP/Makefile.PL.orig	2015-09-03 22:27:45 UTC
74
+++ perl/AnyData_SNMP/Makefile.PL
75
@@ -1,3 +1,4 @@
76
+package AnyData_SNMP;
77
 use ExtUtils::MakeMaker;
78
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
79
 # the contents of the Makefile that is written.
80
--- perl/OID/Makefile.PL.orig	2014-12-08 20:23:22 UTC
81
+++ perl/OID/Makefile.PL
82
@@ -1,3 +1,4 @@
83
+package OID;
84
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
85
 # the contents of the Makefile that is written.
86
 
87
--- perl/SNMP/Makefile.PL.orig	2014-12-08 20:23:22 UTC
88
+++ perl/SNMP/Makefile.PL
89
@@ -1,3 +1,4 @@
90
+package SNMP;
91
 use ExtUtils::MakeMaker;
92
 require 5;
93
 use Config;
94
--- perl/TrapReceiver/Makefile.PL.orig	2014-12-08 20:23:22 UTC
95
+++ perl/TrapReceiver/Makefile.PL
96
@@ -1,3 +1,4 @@
97
+package TrapReceiver;
98
 use ExtUtils::MakeMaker;
99
 require 5;
100
 use Config;
101
--- perl/agent/Makefile.PL.orig	2014-12-08 20:23:22 UTC
102
+++ perl/agent/Makefile.PL
103
@@ -1,3 +1,4 @@
104
+package agent;
105
 use ExtUtils::MakeMaker;
106
 require 5;
107
 use Config;
108
--- perl/agent/Support/Makefile.PL.orig	2014-12-08 20:23:22 UTC
109
+++ perl/agent/Support/Makefile.PL
110
@@ -1,3 +1,4 @@
111
+package agent_Support;
112
 use ExtUtils::MakeMaker;
113
 require 5;
114
 use Config;
115
--- perl/agent/default_store/Makefile.PL.orig	2014-12-08 20:23:22 UTC
116
+++ perl/agent/default_store/Makefile.PL
117
@@ -1,3 +1,4 @@
118
+package agent_default_store;
119
 use ExtUtils::MakeMaker;
120
 require 5;
121
 use Config;
122
--- perl/default_store/Makefile.PL.orig	2014-12-08 20:23:22 UTC
123
+++ perl/default_store/Makefile.PL
124
@@ -1,3 +1,4 @@
125
+package default_store;
126
 use ExtUtils::MakeMaker;
127
 require 5;
128
 use Config;
129
--- perl/manager/Makefile.PL.orig	2014-12-08 20:23:22 UTC
130
+++ perl/manager/Makefile.PL
131
@@ -1,3 +1,4 @@
132
+package manager;
133
 use ExtUtils::MakeMaker;
134
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
135
 # the contents of the Makefile that is written.
(-)files/patch-snmplib_snmp__api.c (-117 lines)
Lines 1-117 Link Here
1
--- snmplib/snmp_api.c.orig	2014-12-08 20:23:22 UTC
2
+++ snmplib/snmp_api.c
3
@@ -4350,10 +4350,9 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char 
4
     u_char          type;
5
     u_char          msg_type;
6
     u_char         *var_val;
7
-    int             badtype = 0;
8
     size_t          len;
9
     size_t          four;
10
-    netsnmp_variable_list *vp = NULL;
11
+    netsnmp_variable_list *vp = NULL, *vplast = NULL;
12
     oid             objid[MAX_OID_LEN];
13
     u_char         *p;
14
 
15
@@ -4493,38 +4492,24 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char 
16
                               (ASN_SEQUENCE | ASN_CONSTRUCTOR),
17
                               "varbinds");
18
     if (data == NULL)
19
-        return -1;
20
+        goto fail;
21
 
22
     /*
23
      * get each varBind sequence 
24
      */
25
     while ((int) *length > 0) {
26
-        netsnmp_variable_list *vptemp;
27
-        vptemp = (netsnmp_variable_list *) malloc(sizeof(*vptemp));
28
-        if (NULL == vptemp) {
29
-            return -1;
30
-        }
31
-        if (NULL == vp) {
32
-            pdu->variables = vptemp;
33
-        } else {
34
-            vp->next_variable = vptemp;
35
-        }
36
-        vp = vptemp;
37
+	vp = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);
38
+	if (NULL == vp)
39
+	    goto fail;
40
 
41
-        vp->next_variable = NULL;
42
-        vp->val.string = NULL;
43
         vp->name_length = MAX_OID_LEN;
44
-        vp->name = NULL;
45
-        vp->index = 0;
46
-        vp->data = NULL;
47
-        vp->dataFreeHook = NULL;
48
         DEBUGDUMPSECTION("recv", "VarBind");
49
         data = snmp_parse_var_op(data, objid, &vp->name_length, &vp->type,
50
                                  &vp->val_len, &var_val, length);
51
         if (data == NULL)
52
-            return -1;
53
+            goto fail;
54
         if (snmp_set_var_objid(vp, objid, vp->name_length))
55
-            return -1;
56
+            goto fail;
57
 
58
         len = MAX_PACKET_LENGTH;
59
         DEBUGDUMPHEADER("recv", "Value");
60
@@ -4604,7 +4589,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char 
61
                 vp->val.string = (u_char *) malloc(vp->val_len);
62
             }
63
             if (vp->val.string == NULL) {
64
-                return -1;
65
+                goto fail;
66
             }
67
             p = asn_parse_string(var_val, &len, &vp->type, vp->val.string,
68
                              &vp->val_len);
69
@@ -4619,7 +4604,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char 
70
             vp->val_len *= sizeof(oid);
71
             vp->val.objid = (oid *) malloc(vp->val_len);
72
             if (vp->val.objid == NULL) {
73
-                return -1;
74
+                goto fail;
75
             }
76
             memmove(vp->val.objid, objid, vp->val_len);
77
             break;
78
@@ -4631,7 +4616,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char 
79
         case ASN_BIT_STR:
80
             vp->val.bitstring = (u_char *) malloc(vp->val_len);
81
             if (vp->val.bitstring == NULL) {
82
-                return -1;
83
+                goto fail;
84
             }
85
             p = asn_parse_bitstring(var_val, &len, &vp->type,
86
                                 vp->val.bitstring, &vp->val_len);
87
@@ -4640,12 +4625,28 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char 
88
             break;
89
         default:
90
             snmp_log(LOG_ERR, "bad type returned (%x)\n", vp->type);
91
-            badtype = -1;
92
+            goto fail;
93
             break;
94
         }
95
         DEBUGINDENTADD(-4);
96
+
97
+	if (NULL == vplast) {
98
+	    pdu->variables = vp;
99
+	} else {
100
+	    vplast->next_variable = vp;
101
+	}
102
+	vplast = vp;
103
+	vp = NULL;
104
     }
105
-    return badtype;
106
+    return 0;
107
+
108
+  fail:
109
+    DEBUGMSGTL(("recv", "error while parsing VarBindList\n"));
110
+    /** if we were parsing a var, remove it from the pdu and free it */
111
+    if (vp)
112
+	snmp_free_var(vp);
113
+
114
+     return -1;
115
 }
116
 
117
 /*
(-)files/patch-snmplib_snmpusm.c (-9 / +9 lines)
Lines 1-11 Link Here
1
--- snmplib/snmpusm.c.orig	2011-07-27 09:58:24.000000000 -0300
1
--- snmplib/snmpusm.c.orig	2018-07-16 14:33:40 UTC
2
+++ snmplib/snmpusm.c	2011-07-27 09:57:48.000000000 -0300
2
+++ snmplib/snmpusm.c
3
@@ -91,6 +91,8 @@
3
@@ -117,6 +117,8 @@ oid             usmDESPrivProtocol[10] = { 1, 3, 6, 1,
4
 oid             usmAESPrivProtocol[10] = { 1, 3, 6, 1, 6, 3, 10, 1, 2, 4 };
4
 oid    usmAESPrivProtocol[10] = { 1, 3, 6, 1, 6, 3, 10, 1, 2, 4 };
5
 /* backwards compat */
5
 /* backwards compat */
6
 oid             *usmAES128PrivProtocol = usmAESPrivProtocol;
6
 oid    *usmAES128PrivProtocol = usmAESPrivProtocol;
7
+oid             *usmAES192PrivProtocol = usmAESPrivProtocol;
7
+oid    *usmAES192PrivProtocol = usmAESPrivProtocol;
8
+oid             *usmAES256PrivProtocol = usmAESPrivProtocol;
8
+oid    *usmAES256PrivProtocol = usmAESPrivProtocol;
9
 
9
 
10
 static u_int    dummy_etime, dummy_eboot;       /* For ISENGINEKNOWN(). */
10
 #ifdef NETSNMP_DRAFT_BLUMENTHAL_AES_04
11
 
11
     /* OIDs from http://www.snmp.com/eso/esoConsortiumMIB.txt */
(-)files/patch-snmpusm.c (-11 lines)
Lines 1-11 Link Here
1
--- snmplib/snmpusm.c.orig	2011-07-27 09:58:24.000000000 -0300
2
+++ snmplib/snmpusm.c	2011-07-27 09:57:48.000000000 -0300
3
@@ -91,6 +91,8 @@
4
 oid             usmAESPrivProtocol[10] = { 1, 3, 6, 1, 6, 3, 10, 1, 2, 4 };
5
 /* backwards compat */
6
 oid             *usmAES128PrivProtocol = usmAESPrivProtocol;
7
+oid             *usmAES192PrivProtocol = usmAESPrivProtocol;
8
+oid             *usmAES256PrivProtocol = usmAESPrivProtocol;
9
 
10
 static u_int    dummy_etime, dummy_eboot;       /* For ISENGINEKNOWN(). */
11
 
(-)files/patch-tcpTable.c (-46 lines)
Lines 1-46 Link Here
1
--- agent/mibgroup/mibII/tcpTable.c.orig	2017-03-15 17:46:37.000000000 +0000
2
+++ agent/mibgroup/mibII/tcpTable.c	2017-03-15 17:46:37.000000000 +0000
3
@@ -96,7 +96,11 @@
4
 
5
 typedef struct netsnmp_inpcb_s netsnmp_inpcb;
6
 struct netsnmp_inpcb_s {
7
+#if __FreeBSD_version >= 1200026
8
+    struct xinpcb   pcb;
9
+#else
10
     struct inpcb    pcb;
11
+#endif
12
     int             state;
13
     netsnmp_inpcb  *inp_next;
14
 };
15
@@ -301,8 +305,10 @@
16
 #ifndef NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS
17
 int
18
 TCP_Count_Connections( void ) {
19
+#if (defined(CAN_USE_SYSCTL) && defined(TCPCTL_PCBLIST))
20
     tcpTable_load(NULL, NULL);
21
     return tcp_estab;
22
+#endif
23
 }
24
 #endif /* NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS */
25
 
26
@@ -923,12 +929,20 @@
27
         nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
28
         if (!nnew)
29
             break;
30
+#if __FreeBSD_version >= 1200026
31
+        nnew->state = StateMap[((NS_ELEM *) xig)->t_state];
32
+#else
33
         nnew->state = StateMap[((NS_ELEM *) xig)->xt_tp.t_state];
34
+#endif
35
         if (nnew->state == 5 /* established */ ||
36
             nnew->state == 8 /*  closeWait  */ )
37
             tcp_estab++;
38
         memcpy(&(nnew->pcb), &(((NS_ELEM *) xig)->xt_inp),
39
+#if __FreeBSD_version >= 1200026
40
+                           sizeof(struct xinpcb));
41
+#else
42
                            sizeof(struct inpcb));
43
+#endif
44
 
45
 	if (nnew->pcb.inp_vflag & INP_IPV6)
46
 	    free(nnew);
(-)files/patch-transform_oids.h (-11 lines)
Lines 1-11 Link Here
1
--- include/net-snmp/library/transform_oids.h.orig	2006-10-28 05:19:44.000000000 +0900
2
+++ include/net-snmp/library/transform_oids.h	2008-03-26 07:50:45.393507729 +0900
3
@@ -23,6 +23,8 @@
4
 /* XXX: OIDs not defined yet */
5
 NETSNMP_IMPORT oid      usmAESPrivProtocol[10]; /* == { 1,3,6,1,6,3,10,1,2,4 }; */
6
 NETSNMP_IMPORT oid      *usmAES128PrivProtocol; /* backwards compat */
7
+NETSNMP_IMPORT oid      *usmAES192PrivProtocol; /* backwards compat */
8
+NETSNMP_IMPORT oid      *usmAES256PrivProtocol; /* backwards compat */
9
 
10
 #define USM_AUTH_PROTO_NOAUTH_LEN 10
11
 #define USM_AUTH_PROTO_MD5_LEN 10
(-)files/patch-udpTable.c (-26 lines)
Lines 1-26 Link Here
1
--- agent/mibgroup/mibII/udpTable.c.orig	2017-03-15 18:08:43.000000000 +0000
2
+++ agent/mibgroup/mibII/udpTable.c	2017-03-15 18:08:43.000000000 +0000
3
@@ -71,7 +71,11 @@
4
 #if defined(freebsd4) || defined(darwin) || defined(osf5)
5
 typedef struct netsnmp_inpcb_s netsnmp_inpcb;
6
 struct netsnmp_inpcb_s {
7
+#if __FreeBSD_version >= 1200026
8
+    struct xinpcb   pcb;
9
+#else
10
     struct inpcb    pcb;
11
+#endif
12
     int             state;
13
     netsnmp_inpcb  *inp_next;
14
 };
15
@@ -670,7 +674,11 @@
16
         nnew = SNMP_MALLOC_TYPEDEF(UDPTABLE_ENTRY_TYPE);
17
         if (!nnew)
18
             break;
19
+#if __FreeBSD_version >= 1200026
20
+        memcpy(&nnew->pcb, xig, sizeof(struct xinpcb));
21
+#else
22
         memcpy(&nnew->pcb, &((struct xinpcb *) xig)->xi_inp, sizeof(struct inpcb));
23
+#endif
24
 	nnew->inp_next = udp_head;
25
 	udp_head   = nnew;
26
 #if defined(dragonfly)
(-)pkg-plist (-5 / +27 lines)
Lines 1-4 Link Here
1
bin/agentxtrap
1
bin/agentxtrap
2
bin/checkbandwidth
2
bin/encode_keychange
3
bin/encode_keychange
3
bin/fixproc
4
bin/fixproc
4
bin/ipf-mod.pl
5
bin/ipf-mod.pl
Lines 18-28 Link Here
18
bin/snmpgetnext
19
bin/snmpgetnext
19
bin/snmpinform
20
bin/snmpinform
20
bin/snmpnetstat
21
bin/snmpnetstat
22
bin/snmppcap
23
bin/snmpping
24
bin/snmpps
21
bin/snmpset
25
bin/snmpset
22
bin/snmpstatus
26
bin/snmpstatus
23
bin/snmptable
27
bin/snmptable
24
bin/snmptest
28
bin/snmptest
25
%%TLS%%bin/snmptls
29
%%TLS%%bin/snmptls
30
bin/snmptop
26
bin/snmptranslate
31
bin/snmptranslate
27
bin/snmptrap
32
bin/snmptrap
28
bin/snmpusm
33
bin/snmpusm
Lines 54-59 Link Here
54
include/net-snmp/agent/mode_end_call.h
59
include/net-snmp/agent/mode_end_call.h
55
include/net-snmp/agent/multiplexer.h
60
include/net-snmp/agent/multiplexer.h
56
include/net-snmp/agent/net-snmp-agent-includes.h
61
include/net-snmp/agent/net-snmp-agent-includes.h
62
include/net-snmp/agent/netsnmp_close_fds.h
57
include/net-snmp/agent/null.h
63
include/net-snmp/agent/null.h
58
include/net-snmp/agent/old_api.h
64
include/net-snmp/agent/old_api.h
59
include/net-snmp/agent/read_only.h
65
include/net-snmp/agent/read_only.h
Lines 110-115 Link Here
110
include/net-snmp/library/md5.h
116
include/net-snmp/library/md5.h
111
include/net-snmp/library/mib.h
117
include/net-snmp/library/mib.h
112
include/net-snmp/library/mt_support.h
118
include/net-snmp/library/mt_support.h
119
include/net-snmp/library/netsnmp-attribute-format.h
113
include/net-snmp/library/oid_stash.h
120
include/net-snmp/library/oid_stash.h
114
include/net-snmp/library/parse.h
121
include/net-snmp/library/parse.h
115
include/net-snmp/library/read_config.h
122
include/net-snmp/library/read_config.h
Lines 120-130 Link Here
120
include/net-snmp/library/snmpCallbackDomain.h
127
include/net-snmp/library/snmpCallbackDomain.h
121
%%TLS%%include/net-snmp/library/snmpDTLSUDPDomain.h
128
%%TLS%%include/net-snmp/library/snmpDTLSUDPDomain.h
122
include/net-snmp/library/snmpTCPDomain.h
129
include/net-snmp/library/snmpTCPDomain.h
123
%%WITH_IPV6%%include/net-snmp/library/snmpTCPIPv6Domain.h
130
include/net-snmp/library/snmpTCPIPv6Domain.h
124
%%TLS%%include/net-snmp/library/snmpTLSBaseDomain.h
131
%%TLS%%include/net-snmp/library/snmpTLSBaseDomain.h
125
%%TLS%%include/net-snmp/library/snmpTLSTCPDomain.h
132
%%TLS%%include/net-snmp/library/snmpTLSTCPDomain.h
126
include/net-snmp/library/snmpUDPDomain.h
133
include/net-snmp/library/snmpUDPDomain.h
127
%%WITH_IPV6%%include/net-snmp/library/snmpUDPIPv6Domain.h
134
include/net-snmp/library/snmpUDPIPv6Domain.h
128
include/net-snmp/library/snmpUnixDomain.h
135
include/net-snmp/library/snmpUnixDomain.h
129
include/net-snmp/library/snmp_alarm.h
136
include/net-snmp/library/snmp_alarm.h
130
include/net-snmp/library/snmp_api.h
137
include/net-snmp/library/snmp_api.h
Lines 142-148 Link Here
142
include/net-snmp/library/snmpusm.h
149
include/net-snmp/library/snmpusm.h
143
include/net-snmp/library/snmpv3-security-includes.h
150
include/net-snmp/library/snmpv3-security-includes.h
144
include/net-snmp/library/snmpv3.h
151
include/net-snmp/library/snmpv3.h
145
%%WITH_IPV6%%include/net-snmp/library/snmpIPv6BaseDomain.h
152
include/net-snmp/library/snmpIPv6BaseDomain.h
146
include/net-snmp/library/snmpUDPBaseDomain.h
153
include/net-snmp/library/snmpUDPBaseDomain.h
147
include/net-snmp/library/snmpUDPIPv4BaseDomain.h
154
include/net-snmp/library/snmpUDPIPv4BaseDomain.h
148
include/net-snmp/library/snmpTCPBaseDomain.h
155
include/net-snmp/library/snmpTCPBaseDomain.h
Lines 177-182 Link Here
177
include/net-snmp/system/darwin8.h
184
include/net-snmp/system/darwin8.h
178
include/net-snmp/system/darwin9.h
185
include/net-snmp/system/darwin9.h
179
include/net-snmp/system/darwin10.h
186
include/net-snmp/system/darwin10.h
187
include/net-snmp/system/darwin11.h
188
include/net-snmp/system/darwin12.h
189
include/net-snmp/system/darwin13.h
190
include/net-snmp/system/darwin14.h
191
include/net-snmp/system/darwin15.h
192
include/net-snmp/system/darwin16.h
193
include/net-snmp/system/darwin17.h
180
include/net-snmp/system/dragonfly.h
194
include/net-snmp/system/dragonfly.h
181
include/net-snmp/system/dynix.h
195
include/net-snmp/system/dynix.h
182
include/net-snmp/system/freebsd.h
196
include/net-snmp/system/freebsd.h
Lines 195-207 Link Here
195
include/net-snmp/system/generic.h
209
include/net-snmp/system/generic.h
196
include/net-snmp/system/hpux.h
210
include/net-snmp/system/hpux.h
197
include/net-snmp/system/irix.h
211
include/net-snmp/system/irix.h
212
include/net-snmp/system/kfreebsd.h
198
include/net-snmp/system/linux.h
213
include/net-snmp/system/linux.h
199
include/net-snmp/system/mingw32.h
214
include/net-snmp/system/mingw32.h
215
include/net-snmp/system/mingw32msvc.h
200
include/net-snmp/system/mips.h
216
include/net-snmp/system/mips.h
201
include/net-snmp/system/netbsd.h
217
include/net-snmp/system/netbsd.h
218
include/net-snmp/system/nto-qnx6.h
202
include/net-snmp/system/openbsd.h
219
include/net-snmp/system/openbsd.h
203
include/net-snmp/system/openbsd4.h
220
include/net-snmp/system/openbsd4.h
204
include/net-snmp/system/openbsd5.h
221
include/net-snmp/system/openbsd5.h
222
include/net-snmp/system/openbsd6.h
205
include/net-snmp/system/osf5.h
223
include/net-snmp/system/osf5.h
206
include/net-snmp/system/solaris.h
224
include/net-snmp/system/solaris.h
207
include/net-snmp/system/solaris2.3.h
225
include/net-snmp/system/solaris2.3.h
Lines 254-259 Link Here
254
man/man1/snmpgetnext.1.gz
272
man/man1/snmpgetnext.1.gz
255
man/man1/snmpinform.1.gz
273
man/man1/snmpinform.1.gz
256
man/man1/snmpnetstat.1.gz
274
man/man1/snmpnetstat.1.gz
275
man/man1/snmpps.1.gz
276
man/man1/snmptop.1.gz
257
man/man1/snmpset.1.gz
277
man/man1/snmpset.1.gz
258
man/man1/snmpstatus.1.gz
278
man/man1/snmpstatus.1.gz
259
man/man1/snmptable.1.gz
279
man/man1/snmptable.1.gz
Lines 376-382 Link Here
376
%%WITH_PERL%%man/man3/NetSNMP::default_store.3.gz
396
%%WITH_PERL%%man/man3/NetSNMP::default_store.3.gz
377
%%WITH_PERL%%man/man3/NetSNMP::netsnmp_request_infoPtr.3.gz
397
%%WITH_PERL%%man/man3/NetSNMP::netsnmp_request_infoPtr.3.gz
378
%%WITH_PERL%%man/man3/SNMP.3.gz
398
%%WITH_PERL%%man/man3/SNMP.3.gz
379
%%WITH_PERL%%%%SITE_ARCH%%/Bundle/Makefile.subs.pl
399
%%WITH_PERL%%%%SITE_ARCH%%/Bundle/MakefileSubs.pm
380
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/ASN.pm
400
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/ASN.pm
381
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/OID.pm
401
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/OID.pm
382
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/TrapReceiver.pm
402
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/TrapReceiver.pm
Lines 431-436 Link Here
431
%%DATADIR%%/mib2c.mfd.conf
451
%%DATADIR%%/mib2c.mfd.conf
432
%%DATADIR%%/mib2c.notify.conf
452
%%DATADIR%%/mib2c.notify.conf
433
%%DATADIR%%/mib2c.old-api.conf
453
%%DATADIR%%/mib2c.old-api.conf
454
%%DATADIR%%/mib2c.org-mode.conf
434
%%DATADIR%%/mib2c.perl.conf
455
%%DATADIR%%/mib2c.perl.conf
435
%%DATADIR%%/mib2c.raw-table.conf
456
%%DATADIR%%/mib2c.raw-table.conf
436
%%DATADIR%%/mib2c.scalar.conf
457
%%DATADIR%%/mib2c.scalar.conf
Lines 553-558 Link Here
553
%%DATADIR%%/mibs/SNMP-USER-BASED-SM-MIB.txt
574
%%DATADIR%%/mibs/SNMP-USER-BASED-SM-MIB.txt
554
%%DATADIR%%/mibs/SNMP-USM-AES-MIB.txt
575
%%DATADIR%%/mibs/SNMP-USM-AES-MIB.txt
555
%%DATADIR%%/mibs/SNMP-USM-DH-OBJECTS-MIB.txt
576
%%DATADIR%%/mibs/SNMP-USM-DH-OBJECTS-MIB.txt
577
%%DATADIR%%/mibs/SNMP-USM-HMAC-SHA2-MIB.txt
556
%%DATADIR%%/mibs/SNMP-VIEW-BASED-ACM-MIB.txt
578
%%DATADIR%%/mibs/SNMP-VIEW-BASED-ACM-MIB.txt
557
%%DATADIR%%/mibs/SNMPv2-CONF.txt
579
%%DATADIR%%/mibs/SNMPv2-CONF.txt
558
%%DATADIR%%/mibs/SNMPv2-MIB.txt
580
%%DATADIR%%/mibs/SNMPv2-MIB.txt
Lines 568-574 Link Here
568
%%DATADIR%%/mibs/UCD-IPFWACC-MIB.txt
590
%%DATADIR%%/mibs/UCD-IPFWACC-MIB.txt
569
%%DATADIR%%/mibs/UCD-SNMP-MIB.txt
591
%%DATADIR%%/mibs/UCD-SNMP-MIB.txt
570
%%DATADIR%%/mibs/UDP-MIB.txt
592
%%DATADIR%%/mibs/UDP-MIB.txt
571
@unexec rm -f %D/%%DATADIR%%/mibs/.index 2>/dev/null || true
593
@preunexec rm -f %D/%%DATADIR%%/mibs/.index 2>/dev/null || true
572
%%WITH_PERL_EMBEDDED%%%%DATADIR%%/snmp_perl.pl
594
%%WITH_PERL_EMBEDDED%%%%DATADIR%%/snmp_perl.pl
573
%%DATADIR%%/snmpconf-data/snmp-data/authopts
595
%%DATADIR%%/snmpconf-data/snmp-data/authopts
574
%%DATADIR%%/snmpconf-data/snmp-data/debugging
596
%%DATADIR%%/snmpconf-data/snmp-data/debugging

Return to bug 232025