|
|
f86639 |
From: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
f86639 |
Date: Thu, 14 Jul 2016 17:51:16 +0300
|
|
|
f86639 |
Subject: [PATCH] Respect -proto_dist switch while connection to EPMD
|
|
|
f86639 |
|
|
|
f86639 |
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
f86639 |
|
|
|
f86639 |
diff --git a/lib/kernel/src/erl_epmd.erl b/lib/kernel/src/erl_epmd.erl
|
|
|
8a7b81 |
index f8ef4a4..79a026a 100644
|
|
|
f86639 |
--- a/lib/kernel/src/erl_epmd.erl
|
|
|
f86639 |
+++ b/lib/kernel/src/erl_epmd.erl
|
|
|
f86639 |
@@ -103,6 +103,10 @@ names(EpmdAddr) ->
|
|
|
f86639 |
|
|
|
f86639 |
register_node(Name, PortNo) ->
|
|
|
f86639 |
register_node(Name, PortNo, inet).
|
|
|
f86639 |
+register_node(Name, PortNo, inet_tcp) ->
|
|
|
f86639 |
+ register_node(Name, PortNo, inet);
|
|
|
f86639 |
+register_node(Name, PortNo, inet6_tcp) ->
|
|
|
f86639 |
+ register_node(Name, PortNo, inet6);
|
|
|
f86639 |
register_node(Name, PortNo, Family) ->
|
|
|
f86639 |
gen_server:call(erl_epmd, {register, Name, PortNo, Family}, infinity).
|
|
|
f86639 |
|
|
|
f86639 |
diff --git a/lib/kernel/src/inet_tcp_dist.erl b/lib/kernel/src/inet_tcp_dist.erl
|
|
|
8a7b81 |
index f91d7ef..94bde55 100644
|
|
|
f86639 |
--- a/lib/kernel/src/inet_tcp_dist.erl
|
|
|
f86639 |
+++ b/lib/kernel/src/inet_tcp_dist.erl
|
|
|
8a7b81 |
@@ -74,7 +74,7 @@ gen_listen(Driver, Name) ->
|
|
|
f86639 |
TcpAddress = get_tcp_address(Driver, Socket),
|
|
|
f86639 |
{_,Port} = TcpAddress#net_address.address,
|
|
|
8a7b81 |
ErlEpmd = net_kernel:epmd_module(),
|
|
|
8a7b81 |
- case ErlEpmd:register_node(Name, Port) of
|
|
|
8a7b81 |
+ case ErlEpmd:register_node(Name, Port, Driver) of
|
|
|
f86639 |
{ok, Creation} ->
|
|
|
f86639 |
{ok, {Socket, TcpAddress, Creation}};
|
|
|
f86639 |
Error ->
|
|
|
8a7b81 |
diff --git a/lib/ssl/src/ssl_tls_dist_proxy.erl b/lib/ssl/src/ssl_tls_dist_proxy.erl
|
|
|
8a7b81 |
index a920f54..08947f2 100644
|
|
|
8a7b81 |
--- a/lib/ssl/src/ssl_tls_dist_proxy.erl
|
|
|
8a7b81 |
+++ b/lib/ssl/src/ssl_tls_dist_proxy.erl
|
|
|
8a7b81 |
@@ -117,7 +117,7 @@ handle_call({listen, Driver, Name}, _From, State) ->
|
|
|
8a7b81 |
{ok, WorldTcpAddress} = get_tcp_address(World),
|
|
|
8a7b81 |
{_,Port} = WorldTcpAddress#net_address.address,
|
|
|
8a7b81 |
ErlEpmd = net_kernel:epmd_module(),
|
|
|
8a7b81 |
- case ErlEpmd:register_node(Name, Port) of
|
|
|
8a7b81 |
+ case ErlEpmd:register_node(Name, Port, Driver) of
|
|
|
8a7b81 |
{ok, Creation} ->
|
|
|
8a7b81 |
{reply, {ok, {Socket, TcpAddress, Creation}},
|
|
|
8a7b81 |
State#state{listen={Socket, World}}};
|