From:             [EMAIL PROTECTED]
Operating system: Windows XP Pro SP1
PHP version:      4CVS-2003-01-31 (stable)
PHP Bug Type:     SNMP related
Bug description:  snmpget returns wrong value on negative integer

I believe i read somewhere that PHP's integer max was 2147483647?

If using snmp to pull bandwidth information from a device (such as
ifInOctets and ifOutOctets), the number DOES constandly rise. If using a
device with snmpv1 (32bit) the counter will only reach a certain number
before it rolls over the the opposite and negative number and counts
toward the maximum again.

The Max (and prolly min?) is the same as PHP's. 

"INTEGER(-2147483648..2147483647) -- corresponds to a signed 32-bit int"


Well, once the counter turns over to the negative, php only returns
"2147483647" for every negative value it reads.


Such as, my ifInOctets for my cisco router is now reading '-1980181848',
and php's snmpget on that oid returns '2147483647', but when the counter
is positive, it returns the correct value.


(this is probably a problem on 64bit snmpv2 since i believe its maximum is
much higher, but thats probably not fix-able)
-- 
Edit bug report at http://bugs.php.net/?id=21992&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=21992&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=21992&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=21992&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=21992&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=21992&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=21992&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=21992&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=21992&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=21992&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=21992&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21992&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=21992&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=21992&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=21992&r=gnused

Reply via email to