aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2014-08-07 17:31:10 +0200
committerRaimo Niskanen <[email protected]>2014-08-07 17:36:08 +0200
commite910f8568a4d19093f7ea8c6865367c3e73703f0 (patch)
tree8db28f80bb377d726cb634ec67817ee71a85b63a /lib/snmp
parent948705328504ca78bce684ded56ce47d35a0068f (diff)
downloadotp-e910f8568a4d19093f7ea8c6865367c3e73703f0.tar.gz
otp-e910f8568a4d19093f7ea8c6865367c3e73703f0.tar.bz2
otp-e910f8568a4d19093f7ea8c6865367c3e73703f0.zip
Fix error printouts to not crash
Diffstat (limited to 'lib/snmp')
-rw-r--r--lib/snmp/src/agent/snmp_framework_mib.erl6
-rw-r--r--lib/snmp/src/agent/snmpa_net_if.erl4
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/snmp/src/agent/snmp_framework_mib.erl b/lib/snmp/src/agent/snmp_framework_mib.erl
index 922215ff00..9d3f7ef5e7 100644
--- a/lib/snmp/src/agent/snmp_framework_mib.erl
+++ b/lib/snmp/src/agent/snmp_framework_mib.erl
@@ -201,9 +201,11 @@ check_agent({intAgentIpAddress, _}, {_, undefined}) ->
check_agent({intAgentIpAddress = Tag, Ip} = Entry, {Domain, Port} = State) ->
{case snmp_conf:check_ip(Domain, Ip) of
ok ->
- [Entry, {intAgentTransports, [{Domain, {Ip, Port}}]}];
+ [Entry,
+ {intAgentTransports, [{Domain, {Ip, Port}}]}];
{ok, FixedIp} ->
- [{Tag, Ip}, {intAgentTransports, [{Domain, {FixedIp, Port}}]}]
+ [{Tag, FixedIp},
+ {intAgentTransports, [{Domain, {FixedIp, Port}}]}]
end, State};
check_agent({intAgentTransports = Tag, Transports}, {_, Port} = State) ->
CheckedTransports =
diff --git a/lib/snmp/src/agent/snmpa_net_if.erl b/lib/snmp/src/agent/snmpa_net_if.erl
index 389c26834d..840d56d563 100644
--- a/lib/snmp/src/agent/snmpa_net_if.erl
+++ b/lib/snmp/src/agent/snmpa_net_if.erl
@@ -1064,7 +1064,7 @@ do_handle_send_pdu1(
"Can not find transport~n"
" size: ~p~n"
" to: ~s",
- [sz(Packet), To]);
+ [sz(Packet), format_address(To)]);
Transport ->
maybe_udp_send(S, Transport, To, Packet)
end;
@@ -1080,7 +1080,7 @@ do_handle_send_pdu1(
"Can not find transport~n"
" size: ~p~n"
" to: ~s",
- [sz(Packet), To]);
+ [sz(Packet), format_address(To)]);
Transport ->
maybe_udp_send(S, Transport, To, Packet, Type, LogData)
end