aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_mpd.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-11-25 20:02:51 +0100
committerMicael Karlberg <[email protected]>2011-11-25 20:02:51 +0100
commit337b7e74ea4c338e08ef9c86056c49c6e2203877 (patch)
treedeb7a08d1d77a7df71a3803724fe87c0104a1734 /lib/snmp/src/agent/snmpa_mpd.erl
parent4062174a7e1f5aa06fd7e125250a125d4cf1f73e (diff)
downloadotp-337b7e74ea4c338e08ef9c86056c49c6e2203877.tar.gz
otp-337b7e74ea4c338e08ef9c86056c49c6e2203877.tar.bz2
otp-337b7e74ea4c338e08ef9c86056c49c6e2203877.zip
[agent] When sending an error message (reply) regarding
snmpUnknownPDUHandlers, the agent used the wrong OID. OTP-9747
Diffstat (limited to 'lib/snmp/src/agent/snmpa_mpd.erl')
-rw-r--r--lib/snmp/src/agent/snmpa_mpd.erl26
1 files changed, 18 insertions, 8 deletions
diff --git a/lib/snmp/src/agent/snmpa_mpd.erl b/lib/snmp/src/agent/snmpa_mpd.erl
index 4f50b1a674..0305e1fbec 100644
--- a/lib/snmp/src/agent/snmpa_mpd.erl
+++ b/lib/snmp/src/agent/snmpa_mpd.erl
@@ -468,15 +468,10 @@ v3_proc(NoteStore, Packet, LocalEngineID, V3Hdr, Data, Log) ->
_ ->
%% 4.2.2.1.2
NIsReportable = snmp_misc:is_reportable_pdu(Type),
- Val = inc(snmpUnknownPDUHandlers),
ErrorInfo =
- {#varbind{oid = ?snmpUnknownPDUHandlers,
- variabletype = 'Counter32',
- value = Val},
- SecName,
- [{securityLevel, SecLevel},
- {contextEngineID, ContextEngineID},
- {contextName, ContextName}]},
+ snmpUnknownPDUHandlers_ei(SecName, SecLevel,
+ ContextEngineID,
+ ContextName),
case generate_v3_report_msg(MsgID,
MsgSecurityModel,
Data, LocalEngineID,
@@ -507,6 +502,21 @@ v3_proc(NoteStore, Packet, LocalEngineID, V3Hdr, Data, Log) ->
end
end.
+make_error_info(Variable, Oid, SecName, Opts) ->
+ Val = inc(Variable),
+ VB = #varbind{oid = Oid,
+ variabletype = 'Counter32',
+ value = Val},
+ {VB, SecName, Opts}.
+
+snmpUnknownPDUHandlers_ei(SecName, SecLevel,
+ ContextEngineID, ContextName) ->
+ Opts = [{securityLevel, SecLevel},
+ {contextEngineID, ContextEngineID},
+ {contextName, ContextName}],
+ make_error_info(snmpUnknownPDUHandlers,
+ ?snmpUnknownPDUHandlers_instance,
+ SecName, Opts).
get_security_module(?SEC_USM) ->
snmpa_usm;