php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43329 snmp2_walk returns wrong value
Submitted: 2007-11-19 05:09 UTC Modified: 2007-11-19 05:39 UTC
From: ras at e-gerbil dot net Assigned:
Status: Not a bug Package: SNMP related
PHP Version: 5.2.5 OS: FreeBSD 7.0-BETA3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ras at e-gerbil dot net
New email:
PHP Version: OS:

 

 [2007-11-19 05:09 UTC] ras at e-gerbil dot net
Description:
------------
snmp2_walk() is occasionally (but consistently) returning the wrong value for certain OIDs on certain devices. snmp2_real_walk(), snmp2_get, and other external utilities all report the correct value.

Reproduce code:
---------------
        $test1 = snmp2_get($dev, $comm, "ifHCInOctets.163");
        $test2 = snmp2_real_walk($dev, $comm, "ifHCInOctets");
        $test3 = snmp2_walk($dev, $comm, "ifHCInOctets");
        $proof = snmp2_walk($dev, $comm, "ifIndex");

        print "SNMP2_GET test: $test1\n";
        print "SNMP2_REAL_WALK test: {$test2['.1.3.6.1.2.1.31.1.1.1.6.163']}\n";
        print "SNMP2_WALK test: {$test3[83]}\n";
        print "Proof that I'm looking at the right ifindex: {$proof[83]}\n";



Expected result:
----------------
I expect snmp2_walk() to return correct results. :)

Actual result:
--------------
SNMP2_GET test: 1280817516439889
SNMP2_REAL_WALK test: 1280817516439889
SNMP2_WALK test: 3545696399506456
Proof that I'm looking at the right ifindex: 163


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-19 05:39 UTC] ras at e-gerbil dot net
Nevermind I'm a tard, it is misaligning, array_values() squishes things because an interface elsewhere on the router wasn't return a value for counters but was for ifdescr... the choice of indexes here really sucks, can't you just give me back an array with a numeric ifindex instead of the whole darn oid. :)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 13:01:29 2025 UTC