Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

modified examples/icmp2.erl to add catch clause in ping/2

  • Loading branch information...
commit 6c25e1516c82c5382dc985f63426e47e2939fc8c 1 parent 6021ee7
@jj1bdx jj1bdx authored committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 examples/icmp2.erl
View
4 examples/icmp2.erl
@@ -64,10 +64,10 @@ ping(IP, N) ->
crypto:start(),
Id = crypto:rand_uniform(0, 16#FFFF),
{Family, Protocol, Addr} =
- case inet:getaddr(IP, inet6) of
+ case (catch inet:getaddr(IP, inet6)) of
{ok, V6Addr} ->
{inet6, icmp6, V6Addr};
- _Else ->
+ {error, _Else} ->
{inet, icmp, IP}
end,
{ok, FD} = procket:open(0, [{protocol, Protocol}, {type, raw}, {family, Family}]),
Please sign in to comment.
Something went wrong with that request. Please try again.