diff options
Diffstat (limited to 'net/net-snmp')
-rw-r--r-- | net/net-snmp/Makefile | 8 | ||||
-rw-r--r-- | net/net-snmp/Makefile.common | 4 | ||||
-rw-r--r-- | net/net-snmp/PLIST | 9 | ||||
-rw-r--r-- | net/net-snmp/distinfo | 17 | ||||
-rw-r--r-- | net/net-snmp/patches/patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c | 50 | ||||
-rw-r--r-- | net/net-snmp/patches/patch-agent_mibgroup_hardware_memory_memory__netbsd.c | 40 | ||||
-rw-r--r-- | net/net-snmp/patches/patch-agent_mibgroup_host_data__access_swrun__kinfo.c | 6 | ||||
-rw-r--r-- | net/net-snmp/patches/patch-du | 18 | ||||
-rw-r--r-- | net/net-snmp/patches/patch-snmplib_mib.c | 437 |
9 files changed, 82 insertions, 507 deletions
diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile index 842aa8dcaa9..8fb8a97f753 100644 --- a/net/net-snmp/Makefile +++ b/net/net-snmp/Makefile @@ -1,7 +1,6 @@ -# $NetBSD: Makefile,v 1.109 2014/11/26 15:45:03 adam Exp $ +# $NetBSD: Makefile,v 1.110 2014/12/31 10:06:57 adam Exp $ .include "Makefile.common" -PKGREVISION= 3 CATEGORIES= net MAINTAINER= adam@NetBSD.org @@ -119,10 +118,9 @@ INSTALLATION_DIRS+= share/examples/net-snmp post-extract: .if ${OPSYS} == "DragonFly" cp ${FILESDIR}/cpu_dragonfly.c ${WRKSRC}/agent/mibgroup/hardware/cpu/cpu_nlist.c -# XXX make it build on OS X 10.9 and OS X 10.10; remove on the next update +# XXX make it build on OS X 10.10; remove on the next update .elif ${OPSYS} == "Darwin" - ln -s ${WRKSRC}/include/net-snmp/system/darwin12.h ${WRKSRC}/include/net-snmp/system/darwin13.h - ln -s ${WRKSRC}/include/net-snmp/system/darwin12.h ${WRKSRC}/include/net-snmp/system/darwin14.h + ln -s ${WRKSRC}/include/net-snmp/system/darwin13.h ${WRKSRC}/include/net-snmp/system/darwin14.h .endif post-wrapper: diff --git a/net/net-snmp/Makefile.common b/net/net-snmp/Makefile.common index b20df30c502..3fb07492d8d 100644 --- a/net/net-snmp/Makefile.common +++ b/net/net-snmp/Makefile.common @@ -1,9 +1,9 @@ -# $NetBSD: Makefile.common,v 1.1 2014/08/05 12:25:13 he Exp $ +# $NetBSD: Makefile.common,v 1.2 2014/12/31 10:06:57 adam Exp $ # used by net/net-snmp/Makefile # used by net/py-netsnmp/Makefile -DISTNAME= net-snmp-5.7.2.1 +DISTNAME= net-snmp-5.7.3 MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=net-snmp/} HOMEPAGE= http://www.net-snmp.org/ diff --git a/net/net-snmp/PLIST b/net/net-snmp/PLIST index 58b21a2d8ef..74fa4896532 100644 --- a/net/net-snmp/PLIST +++ b/net/net-snmp/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.24 2014/03/11 14:05:09 jperkin Exp $ +@comment $NetBSD: PLIST,v 1.25 2014/12/31 10:06:57 adam Exp $ bin/agentxtrap bin/encode_keychange ${PLIST.perl}bin/fixproc @@ -175,6 +175,8 @@ include/net-snmp/system/dragonfly.h include/net-snmp/system/dynix.h include/net-snmp/system/freebsd.h include/net-snmp/system/freebsd10.h +include/net-snmp/system/freebsd11.h +include/net-snmp/system/freebsd12.h include/net-snmp/system/freebsd2.h include/net-snmp/system/freebsd3.h include/net-snmp/system/freebsd4.h @@ -330,6 +332,7 @@ man/man3/snmp_alarm_register.3 man/man3/snmp_alarm_register_hr.3 man/man3/snmp_alarm_unregister.3 man/man3/snmp_api_errstring.3 +man/man3/snmp_async_send.3 man/man3/snmp_clone_pdu.3 man/man3/snmp_clone_varbind.3 man/man3/snmp_close.3 @@ -356,6 +359,7 @@ man/man3/snmp_sess_read.3 man/man3/snmp_sess_select_info.3 man/man3/snmp_sess_send.3 man/man3/snmp_sess_session.3 +man/man3/snmp_sess_synch_response.3 man/man3/snmp_sess_timeout.3 man/man3/snmp_set_mib_errors.3 man/man3/snmp_set_mib_warnings.3 @@ -364,6 +368,7 @@ man/man3/snmp_set_var_objid.3 man/man3/snmp_set_var_typed_integer.3 man/man3/snmp_set_var_typed_value.3 man/man3/snmp_set_var_value.3 +man/man3/snmp_synch_response.3 man/man3/snmp_timeout.3 man/man3/snmp_varlist_add_variable.3 man/man3/snprint_description.3 @@ -518,6 +523,8 @@ share/snmp/mibs/SNMP-MPD-MIB.txt share/snmp/mibs/SNMP-NOTIFICATION-MIB.txt share/snmp/mibs/SNMP-PROXY-MIB.txt share/snmp/mibs/SNMP-TARGET-MIB.txt +share/snmp/mibs/SNMP-TLS-TM-MIB.txt +share/snmp/mibs/SNMP-TSM-MIB.txt share/snmp/mibs/SNMP-USER-BASED-SM-MIB.txt share/snmp/mibs/SNMP-USM-AES-MIB.txt share/snmp/mibs/SNMP-USM-DH-OBJECTS-MIB.txt diff --git a/net/net-snmp/distinfo b/net/net-snmp/distinfo index a578e3e6d3b..e24c0b2b298 100644 --- a/net/net-snmp/distinfo +++ b/net/net-snmp/distinfo @@ -1,17 +1,17 @@ -$NetBSD: distinfo,v 1.83 2014/11/26 15:45:03 adam Exp $ +$NetBSD: distinfo,v 1.84 2014/12/31 10:06:57 adam Exp $ -SHA1 (net-snmp-5.7.2.1.tar.gz) = 815d4e5520a1ed96a27def33e7534b4190599f0f -RMD160 (net-snmp-5.7.2.1.tar.gz) = 129b74e70a5027749c766ea9cdb53a3c4a3cf40b -Size (net-snmp-5.7.2.1.tar.gz) = 6281532 bytes +SHA1 (net-snmp-5.7.3.tar.gz) = 97dc25077257680815de44e34128d365c76bd839 +RMD160 (net-snmp-5.7.3.tar.gz) = c5cf54d5723ee417e07f1f9fa3936aef505104a2 +Size (net-snmp-5.7.3.tar.gz) = 6382428 bytes SHA1 (patch-ac) = 59987ecb9467b1cead9af3d4432a4dd69be93480 SHA1 (patch-af) = 4fb96b79f9126dedb8a132d44894ea23c9e8c101 SHA1 (patch-ag) = d9595eceeb5ee986ab4365f62e3c3ab339e605aa SHA1 (patch-agent_mibgroup_agentx_master.c) = c2b3f145280e3fecc26a431ec914cf89d87a17f4 SHA1 (patch-agent_mibgroup_agentx_master_admin.c) = 3c233c1e3113fbc9c1de34cb4cbacca9ef4a6fe2 -SHA1 (patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c) = 346bb4cb0e905821aa3bbdda4ae0fd8526d35854 +SHA1 (patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c) = 5f1cd89f938b60e57ae87c055a269d3848b6a23e SHA1 (patch-agent_mibgroup_hardware_fsys_fsys_getfsstats.c) = cee9722d9a3f956726a8760b900ed3a375afde3f -SHA1 (patch-agent_mibgroup_hardware_memory_memory__netbsd.c) = f04d66f823bf2b49401e6d9a62db4b39ed679907 -SHA1 (patch-agent_mibgroup_host_data__access_swrun__kinfo.c) = 054866e7c3ac90f183fd4a6d53763a5bba50572c +SHA1 (patch-agent_mibgroup_hardware_memory_memory__netbsd.c) = 928a5aa99e7893ee91dea3110db8098212e328fa +SHA1 (patch-agent_mibgroup_host_data__access_swrun__kinfo.c) = f983ae0d99d85ab1ac6dc7cf2d2c0415b6935258 SHA1 (patch-agent_mibgroup_mibII_ipAddr.c) = cd3345a4b30fe2280d0555ee38feb5f957a55b1e SHA1 (patch-agent_mibgroup_mibII_ipv6.c) = d6a271145e6ba774cbc1e93caa14e3d22dc43075 SHA1 (patch-agent_mibgroup_mibII_tcpTable.c) = f547f3fd08848803cbf7ce08a41ba463c4d02992 @@ -27,10 +27,9 @@ SHA1 (patch-da) = 40e8d78bad93ca12f4c08c43b86e7f13edafc299 SHA1 (patch-db) = 281be9a88860987880c71770f4050fd965dd8ed9 SHA1 (patch-dl) = 92563fd6be6f27be5b348cdc8bc02061374026b0 SHA1 (patch-dt) = 452fee78b37f8ce0eb30049f9f18b04cff9b6e6e -SHA1 (patch-du) = 89a77e82d881207500fb45c422b66710e44c0eb4 +SHA1 (patch-du) = 51d2c7e11b3d422e57ea2f5761aff624f7333842 SHA1 (patch-el) = b85dbef28e14fe29c9fb944508a08e7423a37152 SHA1 (patch-es) = 7336d905bac315f344f93664e4118332f88fb6ee SHA1 (patch-include_net-snmp_agent_snmp__agent.h) = 2139d849b0ffe004a72f3276a98c0d2cb72dca18 SHA1 (patch-include_net-snmp_system_netbsd.h) = 7880fded678147b2cc75e035234b89727e213d00 SHA1 (patch-perl_agent_Makefile.PL) = 722380debeda1552b74b60ff91cea3cbbc716e74 -SHA1 (patch-snmplib_mib.c) = 5177039d844d0e879f78fe7d714ef0385a56c7b7 diff --git a/net/net-snmp/patches/patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c b/net/net-snmp/patches/patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c index 235e223f17a..c94504b57aa 100644 --- a/net/net-snmp/patches/patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c +++ b/net/net-snmp/patches/patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c @@ -1,7 +1,7 @@ -$NetBSD: patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c,v 1.5 2013/04/14 19:45:31 joerg Exp $ +$NetBSD: patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c,v 1.6 2014/12/31 10:06:57 adam Exp $ ---- agent/mibgroup/hardware/cpu/cpu_sysctl.c.orig 2012-10-09 18:28:58.000000000 -0400 -+++ agent/mibgroup/hardware/cpu/cpu_sysctl.c 2013-04-04 20:55:47.000000000 -0400 +--- agent/mibgroup/hardware/cpu/cpu_sysctl.c.orig 2014-12-08 20:23:22.000000000 +0000 ++++ agent/mibgroup/hardware/cpu/cpu_sysctl.c @@ -10,6 +10,7 @@ #include <stdlib.h> @@ -20,7 +20,7 @@ $NetBSD: patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c,v 1.5 2013/04/14 19:45: #ifdef HAVE_VM_VM_PARAM_H #include <vm/vm_param.h> #endif -@@ -43,7 +47,7 @@ +@@ -43,7 +47,7 @@ void init_cpu_sysctl( void ) { int i, n; size_t siz; int ncpu_mib[] = { CTL_HW, HW_NCPU }; @@ -29,7 +29,7 @@ $NetBSD: patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c,v 1.5 2013/04/14 19:45: int model_mib[] = { CTL_HW, HW_MODEL }; #endif char descr[ SNMP_MAXBUF ]; -@@ -51,14 +55,17 @@ +@@ -51,14 +55,17 @@ void init_cpu_sysctl( void ) { strcpy(cpu->name, "Overall CPU statistics"); siz = sizeof(n); @@ -51,10 +51,10 @@ $NetBSD: patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c,v 1.5 2013/04/14 19:45: #endif for ( i = 0; i < n; i++ ) { cpu = netsnmp_cpu_get_byIdx( i, 1 ); -@@ -174,9 +181,11 @@ +@@ -190,9 +197,11 @@ int netsnmp_cpu_arch_load( netsnmp_cache netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 0 ); - #if (defined(__FreeBSD__) || defined(__NetBSD__)) + #if defined(__FreeBSD__) || defined(__NetBSD__) - sysctlbyname("kern.cp_time", cpu_stats, &cpu_size, NULL, 0); + if (sysctlbyname("kern.cp_time", cpu_stats, &cpu_size, NULL, 0) == -1) + snmp_log(LOG_ERR, "sysctl kern.cp_time failed (errno %d)\n", errno); @@ -63,22 +63,22 @@ $NetBSD: patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c,v 1.5 2013/04/14 19:45: + if (sysctl(cpu_mib, 2, cpu_stats, &cpu_size, NULL, 0) == -1) + snmp_log(LOG_ERR, "sysctl kern.cpu failed (errno %d)\n", errno); #endif - cpu->user_ticks = (unsigned long long)cpu_stats[CP_USER]; - cpu->nice_ticks = (unsigned long long)cpu_stats[CP_NICE]; -@@ -190,7 +199,8 @@ + cpu->user_ticks = cpu_stats[CP_USER]; + cpu->nice_ticks = cpu_stats[CP_NICE]; +@@ -206,7 +215,8 @@ int netsnmp_cpu_arch_load( netsnmp_cache * Interrupt/Context Switch statistics * XXX - Do these really belong here ? */ - sysctl(mem_mib, 2, &mem_stats, &mem_size, NULL, 0); + if (sysctl(mem_mib, 2, &mem_stats, &mem_size, NULL, 0) == -1) + snmp_log(LOG_ERR, "sysctl vm.vm_meter failed (errno %d)\n", errno); - cpu->nInterrupts = (unsigned long long)mem_stats.NS_VM_INTR; - cpu->nCtxSwitches = (unsigned long long)mem_stats.NS_VM_SWTCH; - cpu->swapIn = (unsigned long long)mem_stats.NS_VM_SWAPIN; -@@ -201,11 +211,37 @@ - #ifdef NS_VM_PAGEOUT - cpu->pageOut = (unsigned long long)mem_stats.NS_VM_PAGEOUT; + cpu->nInterrupts = mem_stats.NS_VM_INTR; + cpu->nCtxSwitches = mem_stats.NS_VM_SWTCH; + cpu->swapIn = mem_stats.NS_VM_SWAPIN; +@@ -218,6 +228,32 @@ int netsnmp_cpu_arch_load( netsnmp_cache + cpu->pageOut = mem_stats.NS_VM_PAGEOUT; #endif + +#if defined(__NetBSD__) + { + NETSNMP_CPU_STATS *ncpu_stats; @@ -104,13 +104,17 @@ $NetBSD: patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c,v 1.5 2013/04/14 19:45: + free(ncpu_stats); + } +#endif - ++ #ifdef NETSNMP_KERN_MCPU - mcpu_size = cpu_num*sizeof(NETSNMP_KERN_MCPU_TYPE); + #if defined(KERN_CPTIME2) + mcpu_size = cpu_num*sizeof(cpu_stats); +@@ -225,7 +261,8 @@ int netsnmp_cpu_arch_load( netsnmp_cache + #elif defined(__NetBSD__) + mcpu_size = cpu_num*sizeof(cpu_stats); mcpu_stats = malloc(mcpu_size); -- sysctl(mcpu_mib, 2, mcpu_stats, &mcpu_size, NULL, 0); -+ if (sysctl(mcpu_mib, 2, mcpu_stats, &mcpu_size, NULL, 0) == -1) +- sysctlbyname("kern.cp_time", mcpu_stats, &mcpu_size, NULL, 0); ++ if (sysctlbyname("kern.cp_time", mcpu_stats, &mcpu_size, NULL, 0) == -1) + snmp_log(LOG_ERR, "sysctl kern.mcpu failed (errno %d)\n", errno); - for ( i = 0; i < cpu_num; i++ ) { - cpu = netsnmp_cpu_get_byIdx( i, 0 ); - /* XXX - per-CPU statistics - mcpu_mib[i].??? */ + #elif defined(__FreeBSD__) + if (cp_times == -1) { + int ret = sysctlbyname("kern.cp_times", NULL, &mcpu_size, NULL, 0); diff --git a/net/net-snmp/patches/patch-agent_mibgroup_hardware_memory_memory__netbsd.c b/net/net-snmp/patches/patch-agent_mibgroup_hardware_memory_memory__netbsd.c index 1cc31aa6994..d923c3a3cf2 100644 --- a/net/net-snmp/patches/patch-agent_mibgroup_hardware_memory_memory__netbsd.c +++ b/net/net-snmp/patches/patch-agent_mibgroup_hardware_memory_memory__netbsd.c @@ -1,69 +1,69 @@ -$NetBSD: patch-agent_mibgroup_hardware_memory_memory__netbsd.c,v 1.2 2013/04/04 19:59:07 christos Exp $ +$NetBSD: patch-agent_mibgroup_hardware_memory_memory__netbsd.c,v 1.3 2014/12/31 10:06:57 adam Exp $ ---- agent/mibgroup/hardware/memory/memory_netbsd.c.orig 2012-10-09 18:28:58.000000000 -0400 -+++ agent/mibgroup/hardware/memory/memory_netbsd.c 2013-04-04 15:09:23.000000000 -0400 -@@ -48,8 +48,8 @@ +--- agent/mibgroup/hardware/memory/memory_netbsd.c.orig 2014-12-08 20:23:22.000000000 +0000 ++++ agent/mibgroup/hardware/memory/memory_netbsd.c +@@ -48,8 +48,8 @@ int netsnmp_mem_arch_load( netsnmp_cache int uvmexp_mib[] = { CTL_VM, VM_UVMEXP }; int total_mib[] = { CTL_VM, VM_METER }; #else -- unsigned int bufspace; -- unsigned int maxbufspace; +- unsigned long bufspace; +- unsigned long maxbufspace; + uint64_t bufspace; + uint64_t maxbufspace; size_t buf_size = sizeof(bufspace); #endif -@@ -102,6 +102,7 @@ +@@ -102,6 +102,7 @@ int netsnmp_mem_arch_load( netsnmp_cache mem->units = pagesize; mem->size = phys_mem/pagesize; mem->free = total.t_free; -+ mem->other = -1; ++ mem->other = -1; } mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_USERMEM, 1 ); -@@ -113,6 +114,7 @@ +@@ -113,6 +114,7 @@ int netsnmp_mem_arch_load( netsnmp_cache mem->units = pagesize; mem->size = user_mem/pagesize; mem->free = uvmexp.free; -+ mem->other = -1; ++ mem->other = -1; } #if 1 -@@ -125,6 +127,7 @@ +@@ -125,6 +127,7 @@ int netsnmp_mem_arch_load( netsnmp_cache mem->units = pagesize; mem->size = total.t_vm; mem->free = total.t_avm; -+ mem->other = -1; ++ mem->other = -1; } mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SHARED, 1 ); -@@ -136,6 +139,7 @@ +@@ -136,6 +139,7 @@ int netsnmp_mem_arch_load( netsnmp_cache mem->units = pagesize; mem->size = total.t_vmshr; mem->free = total.t_avmshr; -+ mem->other = -1; ++ mem->other = -1; } mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SHARED2, 1 ); -@@ -147,6 +151,7 @@ +@@ -147,6 +151,7 @@ int netsnmp_mem_arch_load( netsnmp_cache mem->units = pagesize; mem->size = total.t_rmshr; mem->free = total.t_armshr; -+ mem->other = -1; ++ mem->other = -1; } #endif -@@ -174,7 +179,8 @@ +@@ -174,7 +179,8 @@ int netsnmp_mem_arch_load( netsnmp_cache mem->descr = strdup("Memory buffers"); mem->units = 1024; mem->size = maxbufspace /1024; - mem->size = (maxbufspace - bufspace)/1024; + mem->free = (maxbufspace - bufspace)/1024; -+ mem->other = -1; ++ mem->other = -1; } #endif -@@ -199,18 +205,28 @@ +@@ -199,18 +205,28 @@ swapinfo(long pagesize) * If there's only one swap device, don't bother */ n = swapctl( SWAP_NSWAP, NULL, 0 ); @@ -98,7 +98,7 @@ $NetBSD: patch-agent_mibgroup_hardware_memory_memory__netbsd.c,v 1.2 2013/04/04 sprintf(buf, "swap %s", s[i].se_path); mem->descr = strdup( buf ); } -@@ -219,5 +235,6 @@ +@@ -219,5 +235,6 @@ swapinfo(long pagesize) mem->free = s[i].se_nblks - s[i].se_inuse; mem->other = -1; } diff --git a/net/net-snmp/patches/patch-agent_mibgroup_host_data__access_swrun__kinfo.c b/net/net-snmp/patches/patch-agent_mibgroup_host_data__access_swrun__kinfo.c index 559bfa265fc..c55b09f9757 100644 --- a/net/net-snmp/patches/patch-agent_mibgroup_host_data__access_swrun__kinfo.c +++ b/net/net-snmp/patches/patch-agent_mibgroup_host_data__access_swrun__kinfo.c @@ -1,10 +1,10 @@ -$NetBSD: patch-agent_mibgroup_host_data__access_swrun__kinfo.c,v 1.2 2013/03/17 00:15:29 gdt Exp $ +$NetBSD: patch-agent_mibgroup_host_data__access_swrun__kinfo.c,v 1.3 2014/12/31 10:06:57 adam Exp $ ---- agent/mibgroup/host/data_access/swrun_kinfo.c.orig 2012-10-09 22:28:58.000000000 +0000 +--- agent/mibgroup/host/data_access/swrun_kinfo.c.orig 2014-12-08 20:23:22.000000000 +0000 +++ agent/mibgroup/host/data_access/swrun_kinfo.c @@ -5,6 +5,10 @@ * - * NB: later FreeBSD uses a different kinfo_proc structure + * NB: later FreeBSD and OpenBSD use different kinfo_proc structures */ +#ifdef __NetBSD__ +#define _KMEMUSER diff --git a/net/net-snmp/patches/patch-du b/net/net-snmp/patches/patch-du index 74af1777add..c14fc2ce881 100644 --- a/net/net-snmp/patches/patch-du +++ b/net/net-snmp/patches/patch-du @@ -1,6 +1,6 @@ -$NetBSD: patch-du,v 1.3 2013/03/17 00:15:29 gdt Exp $ +$NetBSD: patch-du,v 1.4 2014/12/31 10:06:57 adam Exp $ ---- agent/mibgroup/hardware/memory/memory_freebsd.c.orig 2012-10-09 22:28:58.000000000 +0000 +--- agent/mibgroup/hardware/memory/memory_freebsd.c.orig 2014-12-08 20:23:22.000000000 +0000 +++ agent/mibgroup/hardware/memory/memory_freebsd.c @@ -36,6 +36,12 @@ int netsnmp_mem_arch_load( netsnmp_cache long pagesize; @@ -12,10 +12,10 @@ $NetBSD: patch-du,v 1.3 2013/03/17 00:15:29 gdt Exp $ + size_t vmem_size = sizeof(struct vmmeter); +#endif + - struct vmtotal total; - size_t total_size = sizeof(total); - int total_mib[] = { CTL_VM, VM_METER }; -@@ -65,11 +71,17 @@ int netsnmp_mem_arch_load( netsnmp_cache + #if !defined(VM_TOTAL) + unsigned int free_mem; + size_t free_size = sizeof(free_mem); +@@ -76,11 +82,17 @@ int netsnmp_mem_arch_load( netsnmp_cache sysctlbyname("vm.stats.vm.v_inactive_count", &inact_count, &inact_size, NULL, 0); sysctlbyname("vfs.bufspace", &bufspace, &buf_size, NULL, 0); sysctlbyname("vfs.maxbufspace", &maxbufspace, &buf_size, NULL, 0); @@ -33,7 +33,7 @@ $NetBSD: patch-du,v 1.3 2013/03/17 00:15:29 gdt Exp $ /* * ... and save this in a standard form. -@@ -80,9 +92,15 @@ int netsnmp_mem_arch_load( netsnmp_cache +@@ -91,6 +103,11 @@ int netsnmp_mem_arch_load( netsnmp_cache } else { if (!mem->descr) mem->descr = strdup("Physical memory"); @@ -44,7 +44,11 @@ $NetBSD: patch-du,v 1.3 2013/03/17 00:15:29 gdt Exp $ +#else mem->units = pagesize; mem->size = phys_mem/pagesize; + #if !defined(VM_TOTAL) +@@ -98,6 +115,7 @@ int netsnmp_mem_arch_load( netsnmp_cache + #else mem->free = total.t_free; + #endif +#endif } diff --git a/net/net-snmp/patches/patch-snmplib_mib.c b/net/net-snmp/patches/patch-snmplib_mib.c deleted file mode 100644 index 0197e211ccc..00000000000 --- a/net/net-snmp/patches/patch-snmplib_mib.c +++ /dev/null @@ -1,437 +0,0 @@ -$NetBSD: patch-snmplib_mib.c,v 1.1 2014/11/26 15:45:03 adam Exp $ - -Official patch for CVE-2014-3565: -Remote denial-of-service flaw was found in the way snmptrapd handled certain -SNMP traps when started with the "-OQ" option. If an attacker sent an SNMP trap -containing variable with a NULL type where an integer variable type was -expected, it would cause snmptrapd to crash. - ---- snmplib/mib.c.orig 2014-02-20 00:36:42.000000000 +0000 -+++ snmplib/mib.c -@@ -464,17 +464,16 @@ sprint_realloc_octet_string(u_char ** bu - u_char *cp; - int output_format, cnt; - -- if ((var->type != ASN_OCTET_STR) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- const char str[] = "Wrong Type (should be OCTET STRING): "; -- if (snmp_cstrcat -- (buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_OCTET_STR) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ const char str[] = "Wrong Type (should be OCTET STRING): "; -+ if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - -@@ -742,16 +741,16 @@ sprint_realloc_float(u_char ** buf, size - const struct enum_list *enums, - const char *hint, const char *units) - { -- if ((var->type != ASN_OPAQUE_FLOAT) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, -- "Wrong Type (should be Float): ")) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_OPAQUE_FLOAT) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be Float): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { -@@ -812,17 +811,16 @@ sprint_realloc_double(u_char ** buf, siz - const struct enum_list *enums, - const char *hint, const char *units) - { -- if ((var->type != ASN_OPAQUE_DOUBLE) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- if (snmp_cstrcat -- (buf, buf_len, out_len, allow_realloc, -- "Wrong Type (should be Double): ")) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_OPAQUE_DOUBLE) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be Double): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { -@@ -887,20 +885,21 @@ sprint_realloc_counter64(u_char ** buf, - { - char a64buf[I64CHARSZ + 1]; - -- if ((var->type != ASN_COUNTER64 -+ if (var->type != ASN_COUNTER64 - #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES - && var->type != ASN_OPAQUE_COUNTER64 - && var->type != ASN_OPAQUE_I64 && var->type != ASN_OPAQUE_U64 - #endif -- ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, -- "Wrong Type (should be Counter64): ")) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ ) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be Counter64): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { -@@ -988,23 +987,25 @@ sprint_realloc_opaque(u_char ** buf, siz - const struct enum_list *enums, - const char *hint, const char *units) - { -- if ((var->type != ASN_OPAQUE -+ if (var->type != ASN_OPAQUE - #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES - && var->type != ASN_OPAQUE_COUNTER64 - && var->type != ASN_OPAQUE_U64 - && var->type != ASN_OPAQUE_I64 - && var->type != ASN_OPAQUE_FLOAT && var->type != ASN_OPAQUE_DOUBLE - #endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */ -- ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, -- "Wrong Type (should be Opaque): ")) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ ) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be Opaque): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } -+ - #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES - switch (var->type) { - case ASN_OPAQUE_COUNTER64: -@@ -1080,17 +1081,16 @@ sprint_realloc_object_identifier(u_char - { - int buf_overflow = 0; - -- if ((var->type != ASN_OBJECT_ID) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- u_char str[] = -- "Wrong Type (should be OBJECT IDENTIFIER): "; -- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_OBJECT_ID) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be OBJECT IDENTIFIER): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { -@@ -1150,16 +1150,16 @@ sprint_realloc_timeticks(u_char ** buf, - { - char timebuf[40]; - -- if ((var->type != ASN_TIMETICKS) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- u_char str[] = "Wrong Type (should be Timeticks): "; -- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_TIMETICKS) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be Timeticks): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS)) { -@@ -1298,17 +1298,18 @@ sprint_realloc_integer(u_char ** buf, si - { - char *enum_string = NULL; - -- if ((var->type != ASN_INTEGER) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- u_char str[] = "Wrong Type (should be INTEGER): "; -- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_INTEGER) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be INTEGER): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } -+ - for (; enums; enums = enums->next) { - if (enums->value == *var->val.integer) { - enum_string = enums->label; -@@ -1401,16 +1402,16 @@ sprint_realloc_uinteger(u_char ** buf, s - { - char *enum_string = NULL; - -- if ((var->type != ASN_UINTEGER) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- u_char str[] = "Wrong Type (should be UInteger32): "; -- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_UINTEGER) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be UInteger32): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - for (; enums; enums = enums->next) { -@@ -1498,17 +1499,16 @@ sprint_realloc_gauge(u_char ** buf, size - { - char tmp[32]; - -- if ((var->type != ASN_GAUGE) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- u_char str[] = -- "Wrong Type (should be Gauge32 or Unsigned32): "; -- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_GAUGE) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be Gauge32 or Unsigned32): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { -@@ -1571,16 +1571,16 @@ sprint_realloc_counter(u_char ** buf, si - { - char tmp[32]; - -- if ((var->type != ASN_COUNTER) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- u_char str[] = "Wrong Type (should be Counter32): "; -- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_COUNTER) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be Counter32): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { -@@ -1634,16 +1634,16 @@ sprint_realloc_networkaddress(u_char ** - { - size_t i; - -- if ((var->type != ASN_IPADDRESS) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- u_char str[] = "Wrong Type (should be NetworkAddress): "; -- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_IPADDRESS) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be NetworkAddress): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { -@@ -1700,16 +1700,16 @@ sprint_realloc_ipaddress(u_char ** buf, - { - u_char *ip = var->val.string; - -- if ((var->type != ASN_IPADDRESS) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- u_char str[] = "Wrong Type (should be IpAddress): "; -- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_IPADDRESS) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be IpAddress): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { -@@ -1758,20 +1758,20 @@ sprint_realloc_null(u_char ** buf, size_ - const struct enum_list *enums, - const char *hint, const char *units) - { -- if ((var->type != ASN_NULL) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- u_char str[] = "Wrong Type (should be NULL): "; -- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_NULL) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be NULL): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } -- } else { -- u_char str[] = "NULL"; -- return snmp_strcat(buf, buf_len, out_len, allow_realloc, str); - } -+ -+ u_char str[] = "NULL"; -+ return snmp_strcat(buf, buf_len, out_len, allow_realloc, str); - } - - -@@ -1806,16 +1806,16 @@ sprint_realloc_bitstring(u_char ** buf, - u_char *cp; - char *enum_string; - -- if ((var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- u_char str[] = "Wrong Type (should be BITS): "; -- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be BITS): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { -@@ -1890,16 +1890,16 @@ sprint_realloc_nsapaddress(u_char ** buf - const struct enum_list *enums, const char *hint, - const char *units) - { -- if ((var->type != ASN_NSAP) && -- (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { -- u_char str[] = "Wrong Type (should be NsapAddress): "; -- if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { -- return sprint_realloc_by_type(buf, buf_len, out_len, -+ if (var->type != ASN_NSAP) { -+ if (!netsnmp_ds_get_boolean( -+ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { -+ u_char str[] = "Wrong Type (should be NsapAddress): "; -+ if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) -+ return 0; -+ } -+ return sprint_realloc_by_type(buf, buf_len, out_len, - allow_realloc, var, NULL, NULL, - NULL); -- } else { -- return 0; -- } - } - - if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { |