summaryrefslogtreecommitdiff
path: root/net/net-snmp
diff options
context:
space:
mode:
authorseb <seb>2006-10-02 00:09:55 +0000
committerseb <seb>2006-10-02 00:09:55 +0000
commit282c6be31b4062a06e28ff818513495e1d0145bb (patch)
tree84ffce86398c8a2eeef21eeaec45231e12b82c62 /net/net-snmp
parent92f587fee3f489420049ca52c7803d622ab1993a (diff)
downloadpkgsrc-282c6be31b4062a06e28ff818513495e1d0145bb.tar.gz
Fix a NetBSD/sparc64 bug: give sysctl() a pointer on a size_t not on an int!
While here check for sysctl() return value. Now snmpd on NetBSD/sparc64 should report more meaningful values for OIDs like UCD-SNMP-MIB::memAvailReal.0. Bump PKGREVISION.
Diffstat (limited to 'net/net-snmp')
-rw-r--r--net/net-snmp/Makefile3
-rw-r--r--net/net-snmp/distinfo3
-rw-r--r--net/net-snmp/patches/patch-es39
3 files changed, 43 insertions, 2 deletions
diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile
index 10edf82db58..59d08956d93 100644
--- a/net/net-snmp/Makefile
+++ b/net/net-snmp/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.53 2006/09/24 15:04:35 joerg Exp $
+# $NetBSD: Makefile,v 1.54 2006/10/02 00:09:55 seb Exp $
DISTNAME= net-snmp-5.3.1
+PKGREVISION= 1
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=net-snmp/} \
ftp://ftp.net-smnp.org/pub/sourceforge/net-snmp/
diff --git a/net/net-snmp/distinfo b/net/net-snmp/distinfo
index 2c7a9cb5c08..5ac9cc8bb92 100644
--- a/net/net-snmp/distinfo
+++ b/net/net-snmp/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.31 2006/10/01 20:08:29 seb Exp $
+$NetBSD: distinfo,v 1.32 2006/10/02 00:09:55 seb Exp $
SHA1 (net-snmp-5.3.1.tar.gz) = 8ddb5122769814f04a7d3d352dcc640df7c89d41
RMD160 (net-snmp-5.3.1.tar.gz) = 7bcdd213fb2517d0927b030deab5146522b58b3d
@@ -50,4 +50,5 @@ SHA1 (patch-eo) = c1d0acc750c024428bea046fae001c8184242105
SHA1 (patch-ep) = 952e24044ad8a5fe370166d61c76c4760196365c
SHA1 (patch-eq) = 52f831c88fd7d1f2153686bb5288f4f093a0f41f
SHA1 (patch-er) = 1ca5658a6c97210174c83f63cc5791d02037541b
+SHA1 (patch-es) = c26c048ccbda7e4d28cb0a2263cdaa71befb4f96
SHA1 (patch-mib2cupdate) = d6773633c8737fe45a58e378967995e21012d21d
diff --git a/net/net-snmp/patches/patch-es b/net/net-snmp/patches/patch-es
new file mode 100644
index 00000000000..b7630418bce
--- /dev/null
+++ b/net/net-snmp/patches/patch-es
@@ -0,0 +1,39 @@
+$NetBSD: patch-es,v 1.1 2006/10/02 00:09:55 seb Exp $
+
+--- agent/mibgroup/ucd-snmp/memory_netbsd1.c.orig 2005-08-17 12:36:14.000000000 +0000
++++ agent/mibgroup/ucd-snmp/memory_netbsd1.c
+@@ -163,7 +163,7 @@ var_extensible_mem(struct variable *vp,
+ static char errmsg[1024];
+
+ static struct uvmexp uvmexp;
+- int uvmexp_size = sizeof(uvmexp);
++ size_t uvmexp_size = sizeof(uvmexp);
+ int uvmexp_mib[] = { CTL_VM, VM_UVMEXP };
+ static struct vmtotal total;
+ size_t total_size = sizeof(total);
+@@ -179,13 +179,22 @@ var_extensible_mem(struct variable *vp,
+ /*
+ * Memory info
+ */
+- sysctl(uvmexp_mib, 2, &uvmexp, &uvmexp_size, NULL, 0);
+- sysctl(total_mib, 2, &total, &total_size, NULL, 0);
++ if (sysctl(uvmexp_mib, 2, &uvmexp, &uvmexp_size, NULL, 0) == -1) {
++ snmp_log(LOG_ERR, "sysctl VM_UVMEXP failed (errno %d)\n", errno);
++ return NULL;
++ }
++ if (sysctl(total_mib, 2, &total, &total_size, NULL, 0) == -1) {
++ snmp_log(LOG_ERR, "sysctl VM_METER failed (errno %d)\n", errno);
++ return NULL;
++ }
+
+ /*
+ * Physical memory
+ */
+- sysctl(phys_mem_mib, 2, &phys_mem, &phys_mem_size, NULL, 0);
++ if (sysctl(phys_mem_mib, 2, &phys_mem, &phys_mem_size, NULL, 0) == -1) {
++ snmp_log(LOG_ERR, "sysctl HW_USERMEM failed (errno %d)\n", errno);
++ return NULL;
++ }
+
+ long_ret = 0; /* set to 0 as default */
+