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

Collapse All | Expand All

(-)Makefile (-19 / +17 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 18-29 Link Here
18
17
19
BROKEN_SSL=	openssl111
18
BROKEN_SSL=	openssl111
20
19
21
LIB_DEPENDS=	libpkg.so:ports-mgmt/pkg
20
LIB_DEPENDS=	libpkg.so:ports-mgmt/pkg \
21
		libpcre.so:devel/pcre
22
22
23
NOT_FOR_ARCHS=		mips mips64
23
NOT_FOR_ARCHS=		mips mips64
24
NOT_FOR_ARCHS_REASON=	SSP is currently broken on MIPS
24
NOT_FOR_ARCHS_REASON=	SSP is currently broken on MIPS
25
25
26
OPTIONS_DEFINE=	IPV6 MFD_REWRITES PERL PERL_EMBEDDED PYTHON DUMMY TKMIB \
26
OPTIONS_DEFINE=	NOIPV6 MFD_REWRITES PERL PERL_EMBEDDED PYTHON DUMMY TKMIB \
27
		MYSQL AX_SOCKONLY UNPRIVILEGED SMUX DOCS JAIL AX_DISABLE_TRAP \
27
		MYSQL AX_SOCKONLY UNPRIVILEGED SMUX DOCS JAIL AX_DISABLE_TRAP \
28
		TLS NEWSYSLOG
28
		TLS NEWSYSLOG
29
OPTIONS_DEFAULT=PERL PERL_EMBEDDED DUMMY SMUX NEWSYSLOG
29
OPTIONS_DEFAULT=PERL PERL_EMBEDDED DUMMY SMUX NEWSYSLOG
Lines 39-44 Link Here
39
SMUX_DESC=		Build with SNMP multiplexing (SMUX) support
39
SMUX_DESC=		Build with SNMP multiplexing (SMUX) support
40
JAIL_DESC=		Options for running snmpd within a jail(8)
40
JAIL_DESC=		Options for running snmpd within a jail(8)
41
NEWSYSLOG_DESC=		Automatically rotate snmpd.log via newsyslog
41
NEWSYSLOG_DESC=		Automatically rotate snmpd.log via newsyslog
42
NOIPV6_DESC=		Disable IPv6 protocol support
42
43
43
MAKE_JOBS_UNSAFE=	yes
44
MAKE_JOBS_UNSAFE=	yes
44
45
Lines 77-86 Link Here
77
78
78
.include <bsd.port.options.mk>
79
.include <bsd.port.options.mk>
79
80
80
.if ${OSVERSION} >= 1200085
81
EXTRA_PATCHES=	${PATCHDIR}/extra-patch-openssl11
82
.endif
83
84
.if ${PORT_OPTIONS:MPYTHON}
81
.if ${PORT_OPTIONS:MPYTHON}
85
PYDISTUTILS_PKGNAME?=		netsnmp-python
82
PYDISTUTILS_PKGNAME?=		netsnmp-python
86
PYDISTUTILS_PKGVERSION?=	1.0a1
83
PYDISTUTILS_PKGVERSION?=	1.0a1
Lines 141-152 Link Here
141
CONFIGURE_ARGS+=--enable-agentx-dom-sock-only
138
CONFIGURE_ARGS+=--enable-agentx-dom-sock-only
142
.endif
139
.endif
143
140
144
.if ${PORT_OPTIONS:MIPV6}
141
.if ${PORT_OPTIONS:MNOIPV6}
145
CONFIGURE_ARGS+=--enable-ipv6
142
CONFIGURE_ARGS+=--disable-ipv6
146
# --with-transport="UDPIPv6 TCPIPv6" --with-modules=mibII/ipv6"
143
# --with-transport="UDPIPv6 TCPIPv6" --with-modules=mibII/ipv6"
144
PLIST_SUB+=	WITH_IPV6="@comment "
145
.else
147
PLIST_SUB+=	WITH_IPV6=""
146
PLIST_SUB+=	WITH_IPV6=""
148
.else
149
PLIST_SUB+=	WITH_IPV6="@comment "
150
.endif
147
.endif
151
148
152
.if ${PORT_OPTIONS:MUNPRIVILEGED}
149
.if ${PORT_OPTIONS:MUNPRIVILEGED}
Lines 153-160 Link Here
153
CONFIGURE_ARGS+=--without-root-access
150
CONFIGURE_ARGS+=--without-root-access
154
.endif
151
.endif
155
152
156
SHLIB_VERSION=	30
153
SHLIB_VERSION=	35
157
SHLIB_VERSION2=	.0.3
154
SHLIB_VERSION2=	.0.0
158
PLIST_SUB+=	SHLIB_VERSION=${SHLIB_VERSION} SHLIB_VERSION2=${SHLIB_VERSION2}
155
PLIST_SUB+=	SHLIB_VERSION=${SHLIB_VERSION} SHLIB_VERSION2=${SHLIB_VERSION2}
159
SCRIPTS_SUB=	PREFIX=${PREFIX} PERL=${PERL}
156
SCRIPTS_SUB=	PREFIX=${PREFIX} PERL=${PERL}
160
157
Lines 199-205 Link Here
199
BIN_FILES=	snmpbulkwalk snmpget snmpgetnext snmpset \
196
BIN_FILES=	snmpbulkwalk snmpget snmpgetnext snmpset \
200
		snmpstatus snmptest snmptranslate snmptrap snmpwalk \
197
		snmpstatus snmptest snmptranslate snmptrap snmpwalk \
201
		snmptable snmpbulkget snmpdelta snmpdf agentxtrap \
198
		snmptable snmpbulkget snmpdelta snmpdf agentxtrap \
202
		snmpvacm snmpusm encode_keychange snmpnetstat
199
		snmpvacm snmpusm encode_keychange snmpnetstat \
200
		snmppcap snmpping snmptls snmpps
203
LIB_FILES=	libnetsnmp.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
201
LIB_FILES=	libnetsnmp.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
204
		libnetsnmpagent.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
202
		libnetsnmpagent.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
205
		libnetsnmpmibs.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
203
		libnetsnmpmibs.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
Lines 246-258 Link Here
246
244
247
post-patch:
245
post-patch:
248
.for filename in ${SCRIPT_FILES}
246
.for filename in ${SCRIPT_FILES}
249
	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/local/${filename}
247
	${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/local/${filename}
250
.endfor
248
.endfor
251
	@${REINPLACE_CMD} -e 's!utmp_p->ut_name!utmp_p->ut_user!' \
249
	${REINPLACE_CMD} -e 's!utmp_p->ut_name!utmp_p->ut_user!' \
252
	    ${WRKSRC}/agent/mibgroup/host/hr_system.c
250
	    ${WRKSRC}/agent/mibgroup/host/hr_system.c
253
	@${REINPLACE_CMD} -E -e 's|return pci_lookup_name|disabled broken|g' \
251
	${REINPLACE_CMD} -E -e 's|return pci_lookup_name|disabled broken|g' \
254
		${WRKSRC}/configure
252
		${WRKSRC}/configure
255
	@${CP} ${WRKSRC}/include/net-snmp/system/freebsd12.h \
253
	${CP} ${WRKSRC}/include/net-snmp/system/freebsd12.h \
256
		${WRKSRC}/include/net-snmp/system/freebsd13.h
254
		${WRKSRC}/include/net-snmp/system/freebsd13.h
257
255
258
post-configure:
256
post-configure:
(-)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 (-5 / +5 lines)
Lines 1-11 Link Here
1
--- local/Makefile.in.orig	2015-01-19 14:37:56 UTC
1
--- local/Makefile.in.orig	2018-11-02 20:44:00.322724000 +0100
2
+++ local/Makefile.in
2
+++ local/Makefile.in	2018-11-02 20:44:10.079921000 +0100
3
@@ -16,7 +16,7 @@ OTHERUNINSTALL=localuninstall
3
@@ -14,7 +14,7 @@
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 (-11 / +11 lines)
Lines 1-19 Link Here
1
--- Makefile.in.orig	2014-12-08 20:23:22 UTC
1
--- Makefile.in.orig	2018-11-02 19:58:24.488919000 +0100
2
+++ Makefile.in
2
+++ Makefile.in	2018-11-02 19:59:47.322106000 +0100
3
@@ -21,7 +21,7 @@ INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi
3
@@ -22,7 +22,7 @@
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 @@
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_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_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_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 (-12 lines)
Lines 1-17 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	2014-12-08 12:23:22.000000000 -0800
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	2017-04-07 16:05:05.752849000 -0700
3
@@ -153,7 +153,11 @@
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 @@
3
@@ -164,9 +168,24 @@
16
         }
4
         }
17
 
5
 
(-)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-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-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 16:33:40.000000000 +0200
2
+++ snmplib/snmpusm.c	2011-07-27 09:57:48.000000000 -0300
2
+++ snmplib/snmpusm.c	2018-10-07 10:19:02.166439000 +0200
3
@@ -91,6 +91,8 @@
3
@@ -117,6 +117,8 @@
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 */
(-)pkg-plist (-1 / +23 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 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

Return to bug 232025