The attached patch is a simple fix for this bug, just zeroing the
avail field when it would go negative.

A better fix, after 5.7.2, would be to allow the negative value to
pass through by changing the avail field from unsigned to signed.

The MIB declares the object as signed already.

/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_mntent.c 
b/agent/mibgroup/hardware/fsys/fsys_mntent.c
index b9e6b64..abed9bf 100644
--- a/agent/mibgroup/hardware/fsys/fsys_mntent.c
+++ b/agent/mibgroup/hardware/fsys/fsys_mntent.c
@@ -241,7 +241,10 @@ netsnmp_fsys_arch_load( void )
         entry->units =  stat_buf.NSFS_SIZE;
         entry->size  =  stat_buf.f_blocks;
         entry->used  = (stat_buf.f_blocks - stat_buf.f_bfree);
-        entry->avail =  stat_buf.f_bavail;
+        if (stat_buf.f_bavail < 0)
+            entry->avail = 0;
+        else
+            entry->avail =  stat_buf.f_bavail;
         entry->inums_total = stat_buf.f_files;
         entry->inums_avail = stat_buf.f_ffree;
         netsnmp_fsys_calculate32(entry);
------------------------------------------------------------------------------
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