Blame SOURCES/net-snmp-5.5-hrStorage-31bits.patch

9a6c41
1104293 - net-snmp OID 32 bit integer returning number larger than 32 bit signed value
9a6c41
1192221 - net-snmp OID 32 bit integer returning number larger than 32 bit signed value
9a6c41
9a6c41
commit 6a421248afab56035066355727380781d515c545
9a6c41
Author: Jan Safranek <jsafranek@users.sourceforge.net>
9a6c41
Date:   Mon Jan 26 10:40:10 2015 +0100
9a6c41
9a6c41
    Fix 32 bit integeres in hrStorageTable.
9a6c41
    
9a6c41
    RFC says the integers are de-facto 31 bits: 1..2147483647.
9a6c41
9a6c41
diff --git a/agent/mibgroup/host/hrh_storage.c b/agent/mibgroup/host/hrh_storage.c
9a6c41
index ca2f854..96b7198 100644
9a6c41
--- a/agent/mibgroup/host/hrh_storage.c
9a6c41
+++ b/agent/mibgroup/host/hrh_storage.c
9a6c41
@@ -421,7 +421,7 @@ really_try_next:
9a6c41
         if (store_idx > NETSNMP_MEM_TYPE_MAX) {
9a6c41
             if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
9a6c41
                     NETSNMP_DS_AGENT_REALSTORAGEUNITS))
9a6c41
-                long_return = HRFS_entry->units & 0xffffffff;
9a6c41
+                long_return = HRFS_entry->units & 0x7fffffff;
9a6c41
             else
9a6c41
                 long_return = HRFS_entry->units_32;
9a6c41
         } else {
9a6c41
@@ -434,7 +434,7 @@ really_try_next:
9a6c41
         if (store_idx > NETSNMP_MEM_TYPE_MAX) {
9a6c41
             if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
9a6c41
                     NETSNMP_DS_AGENT_REALSTORAGEUNITS))
9a6c41
-                long_return = HRFS_entry->size & 0xffffffff;
9a6c41
+                long_return = HRFS_entry->size & 0x7fffffff;
9a6c41
             else
9a6c41
                 long_return = HRFS_entry->size_32;
9a6c41
         } else {
9a6c41
@@ -447,7 +447,7 @@ really_try_next:
9a6c41
         if (store_idx > NETSNMP_MEM_TYPE_MAX) {
9a6c41
             if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
9a6c41
                     NETSNMP_DS_AGENT_REALSTORAGEUNITS))
9a6c41
-                long_return = HRFS_entry->used & 0xffffffff;
9a6c41
+                long_return = HRFS_entry->used & 0x7fffffff;
9a6c41
             else
9a6c41
                 long_return = HRFS_entry->used_32;
9a6c41
         } else {