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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Mon Jan 27 09:01:25 2020 UTC