aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-02-03 15:19:03 +0100
committerIngela Anderton Andin <[email protected]>2012-02-10 15:34:27 +0100
commit3c3356e20e53e22e40920d4edee0acb7f7a6e8bc (patch)
tree112b26ad3053d2b9cc41762310983a93f897296e
parent647ef86cd72d5646eda0901f59a68e3bd4878a9f (diff)
downloadotp-3c3356e20e53e22e40920d4edee0acb7f7a6e8bc.tar.gz
otp-3c3356e20e53e22e40920d4edee0acb7f7a6e8bc.tar.bz2
otp-3c3356e20e53e22e40920d4edee0acb7f7a6e8bc.zip
Better handling of IPv6
-rw-r--r--lib/ssh/src/ssh.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index e7cedfba3e..29294b836f 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -345,7 +345,13 @@ handle_options([Opt | Rest], SockOpts, Opts) ->
inetopt(true) ->
inet;
inetopt(false) ->
- inet6.
+ case gen_tcp:listen(0, [inet6, {ip, loopback}]) of
+ {ok, Dummyport} ->
+ gen_tcp:close(Dummyport),
+ inet6;
+ _ ->
+ inet
+ end.
%%%
%% Deprecated