#35371 [Opn]: Wrong Values retriving Object with SNMP

From: Date: Fri, 25 Nov 2005 07:37:58 +0000
Subject: #35371 [Opn]: Wrong Values retriving Object with SNMP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-88904@lists.php.net to get a copy of this message
 ID:               35371
 User updated by:  matteo dot bertato at hiport dot it
-Summary:          Wrong Values retriving Object
 Reported By:      matteo dot bertato at hiport dot it
 Status:           Open
 Bug Type:         SNMP related
 Operating System: Fedora Core 2,4
 PHP Version:      4.4.1
 New Comment:

Changed Summary


Previous Comments:
------------------------------------------------------------------------

[2005-11-24 16:44:39] matteo dot bertato at hiport dot it

Description:
------------
Retriving SNMP Object value in SNMP_VALUE_OBJECT mode,
give me wrong result, despite using default mode gives correct result.

(Tested with Net_SNMP 5.2.1.2 on FC4)
(Tested with Net_SNMP 5.1.1 on FC2)
PHP compiled with --with-snmp --enable-ucd-snmp-hack


Reproduce code:
---------------
<?php
print_R(snmpget('1.1.1.1',
'public','1.3.6.1.2.1.2.2.1.6.2')."\n");
snmp_set_valueretrieval(SNMP_VALUE_OBJECT);
print_R(snmpget('1.1.1.1','public','1.3.6.1.2.1.2.2.1.6.2'));
// Getting Mac Address of Second Network Interface
// This is a Standard MIB object
?>


Expected result:
----------------
STRING: 0:50:e8:1:46:e6
stdClass Object
(
    [type] => 4
    [value] => 0:50:e8:1:46:e6
)



Actual result:
--------------
stdClass Object
(
    [type] => 4
    [value] => PèFæ
)

STRING: 0:50:e8:1:46:e6





------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35371&edit=1


Thread (4 messages)

« previous php.bugs (#88904) next »