aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Eckersberg <[email protected]>2017-06-14 12:32:17 -0400
committerJohn Eckersberg <[email protected]>2017-06-14 12:32:17 -0400
commit1fc964a89f5fe360d6d5bc03645b2593221e2afe (patch)
treec748f2fc3d1b49e40215333c281217f273148645 /lib
parent32c4acd35e1f3ca1372daff4fc50946aebb480be (diff)
downloadotp-1fc964a89f5fe360d6d5bc03645b2593221e2afe.tar.gz
otp-1fc964a89f5fe360d6d5bc03645b2593221e2afe.tar.bz2
otp-1fc964a89f5fe360d6d5bc03645b2593221e2afe.zip
Fix erl_epmd:port_please when using IPv6
This mirrors the behavior of inet:gethostbyname when no family or timeout is supplied.
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/src/erl_epmd.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/kernel/src/erl_epmd.erl b/lib/kernel/src/erl_epmd.erl
index 7bc9e2ede3..f96bc88913 100644
--- a/lib/kernel/src/erl_epmd.erl
+++ b/lib/kernel/src/erl_epmd.erl
@@ -79,7 +79,13 @@ port_please(Node, EpmdAddr, Timeout) ->
port_please1(Node,HostName, Timeout) ->
- case inet:gethostbyname(HostName, inet, Timeout) of
+ Family = case inet_db:res_option(inet6) of
+ true ->
+ inet6;
+ false ->
+ inet
+ end,
+ case inet:gethostbyname(HostName, Family, Timeout) of
{ok,{hostent, _Name, _ , _Af, _Size, [EpmdAddr | _]}} ->
get_port(Node, EpmdAddr, Timeout);
Else ->