From 1fc964a89f5fe360d6d5bc03645b2593221e2afe Mon Sep 17 00:00:00 2001 From: John Eckersberg Date: Wed, 14 Jun 2017 12:32:17 -0400 Subject: Fix erl_epmd:port_please when using IPv6 This mirrors the behavior of inet:gethostbyname when no family or timeout is supplied. --- lib/kernel/src/erl_epmd.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/kernel') 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 -> -- cgit v1.2.3