aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-05-24 14:15:49 +0200
committerMicael Karlberg <[email protected]>2019-05-28 12:22:54 +0200
commitfb3bbd7ce7e6ecbc7c70f7d724cb041017a73937 (patch)
tree3c4b386eb28b32489c09e601b2c29ce40259cd28
parentdb4c234f442f43a0160dee71d9ca02c08c353ae9 (diff)
downloadotp-fb3bbd7ce7e6ecbc7c70f7d724cb041017a73937.tar.gz
otp-fb3bbd7ce7e6ecbc7c70f7d724cb041017a73937.tar.bz2
otp-fb3bbd7ce7e6ecbc7c70f7d724cb041017a73937.zip
[snmp|test] Add more printouts to understand IPv6 issues
OTP-15764
-rw-r--r--lib/snmp/test/snmp_test_mgr.erl17
-rw-r--r--lib/snmp/test/snmp_test_mgr_misc.erl3
2 files changed, 16 insertions, 4 deletions
diff --git a/lib/snmp/test/snmp_test_mgr.erl b/lib/snmp/test/snmp_test_mgr.erl
index 9190c07e6d..9d6be65088 100644
--- a/lib/snmp/test/snmp_test_mgr.erl
+++ b/lib/snmp/test/snmp_test_mgr.erl
@@ -247,10 +247,21 @@ init({Options, CallerPid}) ->
IpFamily = get_value(ipfamily, Options, inet),
print("[~w] ~p -> IpFamily: ~p~n", [?MODULE, self(), IpFamily]),
AgIp = case snmp_misc:assq(agent, Options) of
- {value, Tuple4} when is_tuple(Tuple4) andalso
- (size(Tuple4) =:= 4) ->
- Tuple4;
+ {value, Addr} when is_tuple(Addr) andalso
+ (size(Addr) =:= 4) andalso
+ (IpFamily =:= inet) ->
+ print("[~w] ~p -> Addr: ~p~n",
+ [?MODULE, self(), Addr]),
+ Addr;
+ {value, Addr} when is_tuple(Addr) andalso
+ (size(Addr) =:= 8) andalso
+ (IpFamily =:= inet6) ->
+ print("[~w] ~p -> Addr: ~p~n",
+ [?MODULE, self(), Addr]),
+ Addr;
{value, Host} when is_list(Host) ->
+ print("[~w] ~p -> Host: ~p~n",
+ [?MODULE, self(), Host]),
{ok, Ip} = snmp_misc:ip(Host, IpFamily),
Ip
end,
diff --git a/lib/snmp/test/snmp_test_mgr_misc.erl b/lib/snmp/test/snmp_test_mgr_misc.erl
index 315e3ebd9e..6608a88c00 100644
--- a/lib/snmp/test/snmp_test_mgr_misc.erl
+++ b/lib/snmp/test/snmp_test_mgr_misc.erl
@@ -576,6 +576,7 @@ vsn('version-2') -> v2c.
udp_send(UdpId, AgentIp, UdpPort, B) ->
+ ?vlog("attempt send message (~w bytes) to ~p", [sz(B), {AgentIp, UdpPort}]),
case (catch gen_udp:send(UdpId, AgentIp, UdpPort, B)) of
{error,ErrorReason} ->
error("failed (error) sending message to ~p:~p: "
@@ -880,7 +881,7 @@ display_prop_hdr(S) ->
%%----------------------------------------------------------------------
sz(L) when is_list(L) ->
- length(lists:flatten(L));
+ iolist_size(L);
sz(B) when is_binary(B) ->
size(B);
sz(O) ->