Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > c0394d3068b44395994f031447c8052d > files > 14

net-snmp-5.3.2.2-7.el5_4.2.src.rpm

386821: CRM #1761334 snmpd errors [ Truncation errors]

Source: Jan Safranek <jsafrane@redhat.com>
Reviewed-By: Radek Vokal <rvokal@redhat.com>

Fixes returning of COUNTER values from UCD-DISKIO-MIB.
The MIB implementation does not cut 64 bit values to 32 bits before passing to
ASN1 message encoder. The encoder then complains "truncating integer value > 32 
bits" to syslog.

--- agent/mibgroup/ucd-snmp/diskio.c.bak	2008-01-08 12:01:11.000000000 +0100
+++ agent/mibgroup/ucd-snmp/diskio.c	2008-01-08 13:16:44.000000000 +0100
@@ -806,16 +806,16 @@ var_diskio(struct variable * vp,
       *var_len = strlen(head.indices[indx].name);
       return (u_char *) head.indices[indx].name;
     case DISKIO_NREAD:
-      long_ret = head.indices[indx].rsect*512;
+      long_ret = (head.indices[indx].rsect*512) & 0xffffffff;
       return (u_char *) & long_ret;
     case DISKIO_NWRITTEN:
-      long_ret = head.indices[indx].wsect*512;
+      long_ret = (head.indices[indx].wsect*512) & 0xffffffff;
       return (u_char *) & long_ret;
     case DISKIO_READS:
-      long_ret = head.indices[indx].rio;
+      long_ret = (head.indices[indx].rio) & 0xffffffff;
       return (u_char *) & long_ret;
     case DISKIO_WRITES:
-      long_ret = head.indices[indx].wio;
+      long_ret = (head.indices[indx].wio) & 0xffffffff;
       return (u_char *) & long_ret;
     case DISKIO_NREADX:
       *var_len = sizeof(struct counter64);