From fc59c2ce6ea83028cafb2af0f34917ed038a123e Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Jun 16 2017 14:44:33 +0000 Subject: Fix EPMD port assignment in IPv6 environment See this PR for the details: * https://github.com/erlang/otp/pull/erlang/otp/pull/1487 Signed-off-by: Peter Lemenkov --- diff --git a/erlang.spec b/erlang.spec index 320334c..32b5638 100644 --- a/erlang.spec +++ b/erlang.spec @@ -66,7 +66,7 @@ Name: erlang Version: 19.3.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General-purpose programming language and runtime environment Group: Development/Languages @@ -119,6 +119,9 @@ Patch6: otp-0006-Do-not-install-erlang-sources.patch # Fedora specific patch # Fix CVE-2016-10253 Patch7: otp-0007-Fix-CVE-2016-10253.patch +# Fedora specific patch +# Fix erl_epmd:port_please when using IPv6 +Patch8: otp-0008-Fix-erl_epmd-port_please-when-using-IPv6.patch # end of autogenerated patch tag list BuildRequires: flex @@ -932,6 +935,7 @@ Provides support for XML 1.0. %patch5 -p1 -b .Do_not_install_nteventlog_and_related_doc_files_on_n %patch6 -p1 -b .Do_not_install_erlang_sources %patch7 -p1 -b .Fix_CVE_2016_10253 +%patch8 -p1 -b .Fix_erl_epmd_port_please_when_using_IPv6 # end of autogenerated prep patch list # FIXME we should come up with a better solution @@ -2322,6 +2326,9 @@ useradd -r -g epmd -d /dev/null -s /sbin/nologin \ %changelog +* Fri Jun 16 2017 Peter Lemenkov - 19.3.6-2 +- Fix EPMD port assignment in IPv6 env. (GH#1487) + * Tue Jun 13 2017 Peter Lemenkov - 19.3.6-1 - Ver. 19.3.6 diff --git a/otp-0008-Fix-erl_epmd-port_please-when-using-IPv6.patch b/otp-0008-Fix-erl_epmd-port_please-when-using-IPv6.patch new file mode 100644 index 0000000..866d325 --- /dev/null +++ b/otp-0008-Fix-erl_epmd-port_please-when-using-IPv6.patch @@ -0,0 +1,26 @@ +From: John Eckersberg +Date: Wed, 14 Jun 2017 12:32:17 -0400 +Subject: [PATCH] Fix erl_epmd:port_please when using IPv6 + +This mirrors the behavior of inet:gethostbyname when no family or +timeout is supplied. + +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 ->