From: Operating system: * PHP version: Irrelevant Package: SNMP related Bug Type: Bug Bug description:snmprealwalk (snmp v1) does not handle end of OID tree correctly
Description: ------------ When snmprealwalk is asked for complete OID tree (thus it may not be . OID but every OID prefix covers system-wide last OID) it does not handle nosuchname error (that is used in snmpv1 as NOSUCHINSTANCE) reported by agent correctly showing nonsense warnings. This is because error handling case does not `know' about SNMP_CMD_REALWALK query type, only about SNMP_CMD_WALK. Test script: --------------- <?php $machine_ip = "127.0.0.1"; $community = "public"; $oid= ".1.3.6.1"; #$oid= ".1.3.6.1.2.1.1"; snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC); $walk_result = snmprealwalk($machine_ip, $community, $oid); if (empty($walk_result)) { print "It's busted\n"; exit(0); } else { print "Number of entries: " . count($walk_result) . "\n"; } ?> Expected result: ---------------- Number of entries: <about 4k> Actual result: -------------- PHP Warning: snmprealwalk(): Error in packet: (noSuchName) There is no such variable name in this MIB. in /home/nc/tmp/perl-snmp-test-case/case-1/php-walk-case1.php on line 8 PHP Warning: snmprealwalk(): This name does not exist: iso.3.6.1.6.3.16.1.5.2.1.6.6.115.121.115.116.101.109.1.1 in /home/nc/tmp/perl-snmp-test-case/case-1/php-walk-case1.php on line 8 It's busted -- Edit bug report at http://bugs.php.net/bug.php?id=51336&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51336&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51336&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51336&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51336&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51336&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51336&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51336&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51336&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51336&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51336&r=support Expected behavior: http://bugs.php.net/fix.php?id=51336&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51336&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51336&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51336&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51336&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=51336&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51336&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51336&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51336&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51336&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51336&r=mysqlcfg