aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2017-07-06 14:33:30 +0200
committerGitHub <[email protected]>2017-07-06 14:33:30 +0200
commit9e9ad191ce49eb410c7a95a8410122eed8049755 (patch)
treefbadac092533810e6a08072b47066b14a6ce08cc
parent7ef43d456837b012bf0b5ff751701dc1c6becd25 (diff)
parent1fc964a89f5fe360d6d5bc03645b2593221e2afe (diff)
downloadotp-9e9ad191ce49eb410c7a95a8410122eed8049755.tar.gz
otp-9e9ad191ce49eb410c7a95a8410122eed8049755.tar.bz2
otp-9e9ad191ce49eb410c7a95a8410122eed8049755.zip
jeckersb/port_please-ipv6/PR-1487/OTP-14501
Fix erl_epmd:port_please when using IPv6
-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 ->