|  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
 [2007-11-19 05:09 UTC] ras at e-gerbil dot net
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['.']}\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


Add a Patch

Pull Requests

Add a Pull Request


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-2020 The PHP Group
All rights reserved.
Last updated: Fri Jun 05 22:01:23 2020 UTC