diff options
author | sekiya <sekiya@pkgsrc.org> | 2010-12-22 08:13:30 +0000 |
---|---|---|
committer | sekiya <sekiya@pkgsrc.org> | 2010-12-22 08:13:30 +0000 |
commit | 14e6f5c4aa6ca798dc0f848afdeb902ae39ed3a0 (patch) | |
tree | ac073a9de96eb1c32e756ff2d27e8f107d19020c /net/net-snmp | |
parent | 7e53d56e7b3e7730a4ce4944371fb8b775233ed2 (diff) | |
download | pkgsrc-14e6f5c4aa6ca798dc0f848afdeb902ae39ed3a0.tar.gz |
Fix divide-by-zero error in CPU performance statistics.
Inspired by Red Hat Bugzilla Bug #501210.
Diffstat (limited to 'net/net-snmp')
-rw-r--r-- | net/net-snmp/Makefile | 4 | ||||
-rw-r--r-- | net/net-snmp/distinfo | 3 | ||||
-rw-r--r-- | net/net-snmp/patches/patch-fc | 40 |
3 files changed, 44 insertions, 3 deletions
diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile index 49b1a11aa94..7e330bab4c1 100644 --- a/net/net-snmp/Makefile +++ b/net/net-snmp/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.82 2010/08/21 16:35:20 seb Exp $ +# $NetBSD: Makefile,v 1.83 2010/12/22 08:13:30 sekiya Exp $ DISTNAME= net-snmp-5.4.3 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=net-snmp/} diff --git a/net/net-snmp/distinfo b/net/net-snmp/distinfo index a5a4fae7118..ca54f0a246b 100644 --- a/net/net-snmp/distinfo +++ b/net/net-snmp/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.57 2010/11/17 00:59:06 taca Exp $ +$NetBSD: distinfo,v 1.58 2010/12/22 08:13:30 sekiya Exp $ SHA1 (net-snmp-5.4.3.tar.gz) = 849a20ddeaa90b1b0010e487876927e615b5c6bc RMD160 (net-snmp-5.4.3.tar.gz) = 417f47c301c3221a64f37162b56b4661c9f6d8cb @@ -53,3 +53,4 @@ SHA1 (patch-ey) = ff5f0fbcbea699f5ae628b315b39a676acb8d190 SHA1 (patch-ez) = dc7ef797733fd930f2a3dacb8c28151371706dfc SHA1 (patch-fa) = 9478aa624fbdc82b54d1e7f50f4e2ee0518dcb92 SHA1 (patch-fb) = 64d97a51d82488ef4d3ea5dd40278501975d58fb +SHA1 (patch-fc) = 4e0b9841cbff0da02748efc9105096ffcbe58e81 diff --git a/net/net-snmp/patches/patch-fc b/net/net-snmp/patches/patch-fc new file mode 100644 index 00000000000..205b3ee4539 --- /dev/null +++ b/net/net-snmp/patches/patch-fc @@ -0,0 +1,40 @@ +$NetBSD: patch-fc,v 1.1 2010/12/22 08:13:30 sekiya Exp $ + +--- agent/mibgroup/ucd-snmp/vmstat.c.orig 2010-12-22 15:46:31.000000000 +0900 ++++ agent/mibgroup/ucd-snmp/vmstat.c 2010-12-22 15:48:47.000000000 +0900 +@@ -129,7 +129,10 @@ + case CPUUSER: + if ( info->history && info->history[0].total_hist ) { + value = (info->user_ticks - info->history[0].user_hist)*100; +- value /= (info->total_ticks - info->history[0].total_hist); ++ if (info->total_ticks > info->history[0].total_hist) ++ value /= (info->total_ticks - info->history[0].total_hist); ++ else ++ value = 0; + snmp_set_var_typed_integer(requests->requestvb, + ASN_INTEGER, value); + } +@@ -138,7 +141,10 @@ + if ( info->history && info->history[0].total_hist ) { + /* or sys2_ticks ??? */ + value = (info->sys_ticks - info->history[0].sys_hist)*100; +- value /= (info->total_ticks - info->history[0].total_hist); ++ if (info->total_ticks > info->history[0].total_hist) ++ value /= (info->total_ticks - info->history[0].total_hist); ++ else ++ value = 0; + snmp_set_var_typed_integer(requests->requestvb, + ASN_INTEGER, value); + } +@@ -146,7 +152,10 @@ + case CPUIDLE: + if ( info->history && info->history[0].total_hist ) { + value = (info->idle_ticks - info->history[0].idle_hist)*100; +- value /= (info->total_ticks - info->history[0].total_hist); ++ if (info->total_ticks > info->history[0].total_hist) ++ value /= (info->total_ticks - info->history[0].total_hist); ++ else ++ value = 0; + snmp_set_var_typed_integer(requests->requestvb, + ASN_INTEGER, value); + } |