[erlang-bugs] SNMP get-request failure
Stefan Zegenhagen
stefan.zegenhagen@REDACTED
Mon Apr 7 10:13:16 CEST 2014
Dear all,
we have discovered at least one SNMP manager that composes get-requests
like this:
{pdu,'get-request',15,noError,0,[{varbind,<OID>,'INTEGER',0,1}]}
Please note that the get-request does not contain 'NULL', 'NULL' as
variabletype and value, but contains a valid type/value pair. To my
knowledge, this is not forbidden.
When the OID is not accessible (e.g. MAX-ACCESS is not-accessible or
accessible-for-notify), the following response-PDU is generated:
{pdu,'get-response',15,noError,0,[{varbind,<OID>,'INTEGER',noSuchInstance,1}
Please not again that the variabletype is still the one from the
original requests, e.g. the PDU processing in snmpa_agent:process_pdu/5
fails to update #varbind.variabletype when detecting errors.
This response PDU fails to encode because of the ordering of the clauses
in snmp_pdus:enc_value/2 which checks for basic BER types first, before
considering known error atoms as values.
The same problem does not exist when the instrumentation function for
that object returns {noValue, Error} because the 'noValue' atom is
copied to #varbind.variabletype in that case.
A fix should probably:
* reorder the clauses in snmp_pdus:enc_value/2,
* overwrite #varbind.variabletype with 'NULL' or 'noValue' when
detecting errors,
* or do both of the above solutions.
Kind regards,
--
Dr. Stefan Zegenhagen
arcutronix GmbH
Garbsener Landstr. 10
30419 Hannover
Germany
Tel: +49 511 277-2734
Fax: +49 511 277-2709
Email: stefan.zegenhagen@REDACTED
Web: www.arcutronix.com
*Synchronize the Ethernet*
General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer -
Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht
Hannover; Ust-Id: DE257551767.
Please consider the environment before printing this message.
More information about the erlang-bugs
mailing list