summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/snmp/src/agent/snmpa_mpd.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_net_if.erl25
-rw-r--r--lib/snmp/src/agent/snmpa_trap.erl3
3 files changed, 26 insertions, 4 deletions
diff --git a/lib/snmp/src/agent/snmpa_mpd.erl b/lib/snmp/src/agent/snmpa_mpd.erl
index 2ec5dcb5e6..552b9671af 100644
--- a/lib/snmp/src/agent/snmpa_mpd.erl
+++ b/lib/snmp/src/agent/snmpa_mpd.erl
@@ -397,7 +397,7 @@ v3_proc(NoteStore, Packet, LocalEngineID, V3Hdr, Data, Log) ->
#note{sec_engine_id = SecEngineID,
sec_model = _MsgSecModel,
sec_name = SecName,
- sec_level = SecLevel,
+ sec_level = _SecLevel, % OTP-16207
ctx_engine_id = _CtxEngineID,
ctx_name = _CtxName,
disco = true,
diff --git a/lib/snmp/src/agent/snmpa_net_if.erl b/lib/snmp/src/agent/snmpa_net_if.erl
index 58c01146be..eefe864ac6 100644
--- a/lib/snmp/src/agent/snmpa_net_if.erl
+++ b/lib/snmp/src/agent/snmpa_net_if.erl
@@ -738,6 +738,26 @@ handle_discovery_response(
%% should be redundant.
NReqs = lists:keydelete(ReqId, 1, Reqs),
S#state{reqs = NReqs};
+
+ %% <OTP-16207>
+ %% For some reason 'snmptrapd' response in stage 2 with request-id
+ %% of zero.
+ false when (ReqId =:= 0) ->
+ DiscoReqs = [X|| {0, From1} <- S#state.reqs,
+ {_, From2} = X <- S#state.reqs, From1 =:= From2],
+ case (length(DiscoReqs) =:= 2) of
+ true ->
+ [{_, Pid}, _] = DiscoReqs,
+ active_once(Socket),
+ Pid ! {snmp_discovery_response_received, Pdu,
+ ManagerEngineId},
+ NReqs = S#state.reqs -- DiscoReqs,
+ S#state{reqs = NReqs};
+ false ->
+ S
+ end;
+ %% </OTP-16207>
+
false ->
%% Ouch, timeout? resend?
S
@@ -1013,8 +1033,9 @@ handle_send_discovery(
log(Log, Type, Packet, {Domain, Address}),
udp_send(Socket, {Domain, Address}, Packet),
?vtrace("handle_send_discovery -> sent (~w)", [ReqId]),
- NReqs = snmp_misc:keyreplaceadd(From, 2, Reqs, {ReqId, From}),
- S#state{reqs = NReqs}
+ NReqs = snmp_misc:keyreplaceadd(From, 2, Reqs, {ReqId, From}),
+ NReqs2 = (NReqs -- [{0, From}]) ++ [{0, From}], % OTP-16207
+ S#state{reqs = NReqs2}
end;
{discarded, Reason} ->
?vlog("handle_send_discovery -> "
diff --git a/lib/snmp/src/agent/snmpa_trap.erl b/lib/snmp/src/agent/snmpa_trap.erl
index 119207c76b..62f35cdaf9 100644
--- a/lib/snmp/src/agent/snmpa_trap.erl
+++ b/lib/snmp/src/agent/snmpa_trap.erl
@@ -388,7 +388,8 @@ send_discovery(TargetName, Record, ContextName, Vbs, NetIf) ->
send_discovery(TargetName, Record, ContextName, Vbs, NetIf, ExtraInfo) ->
case find_dest(TargetName) of
{ok, Dest} ->
- send_discovery_pdu(Dest, Record, ContextName, Vbs, NetIf,
+ Vbs2 = make_varbind_list(Vbs), % OTP-16207
+ send_discovery_pdu(Dest, Record, ContextName, Vbs2, NetIf,
ExtraInfo);
Error ->
Error