The attached patch makes sure that we populate hrStorageTable on AIX.
The module in question is only used under AIX.

/Niels

-- 
Niels Baggesen - @home - Ã…rhus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming
diff --git a/agent/mibgroup/hardware/fsys/fsys_mntctl.c 
b/agent/mibgroup/hardware/fsys/fsys_mntctl.c
index 3ad68d4..a03019a 100644
--- a/agent/mibgroup/hardware/fsys/fsys_mntctl.c
+++ b/agent/mibgroup/hardware/fsys/fsys_mntctl.c
@@ -81,7 +81,7 @@ netsnmp_fsys_arch_init( void )
 void
 netsnmp_fsys_arch_load( void )
 {
-    int  ret  = 0;
+    int  ret  = 0, i = 0;
     uint size = 0;
 
     struct vmount *aixmnt, *aixcurr;
@@ -118,18 +118,18 @@ netsnmp_fsys_arch_load( void )
      * ... and insert this into the filesystem container.
      */
 
-    for ( aixcurr  = aixmnt;
-         (aixcurr-aixmnt) >= size;
-          aixcurr  = (char*)aixcurr + aixcurr->vmt_length ) {
+    for (i = 0;
+         i < ret;
+         i++, aixcurr = (struct vmount *) ((char*)aixcurr + 
aixcurr->vmt_length) ) {
 
-        path = vmt2dataptr( aixcurr, VMT_OBJECT );
+        path = vmt2dataptr( aixcurr, VMT_STUB );
         entry = netsnmp_fsys_by_path( path, NETSNMP_FS_FIND_CREATE );
         if (!entry) {
             continue;
         }
 
         strlcpy(entry->path, path, sizeof(entry->path));
-        strlcpy(entry->device, vmt2dataptr(aixcurr, VMT_STUB),
+        strlcpy(entry->device, vmt2dataptr(aixcurr, VMT_OBJECT),
                 sizeof(entry->device));
         entry->type   = _fsys_type( aixcurr->vmt_gfstype );
 
@@ -144,8 +144,7 @@ netsnmp_fsys_arch_load( void )
          *  The root device is presumably bootable.
          *  Other partitions probably aren't!
          */
-        if ((entry->path[0] == '/') &&
-            (entry->path[1] == '\0'))
+        if ((entry->path[0] == '/') && (entry->path[1] == '\0'))
             entry->flags |= NETSNMP_FS_FLAG_BOOTABLE;
 
         /*
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to