From 3c1f8435a9032667e207d92d21777612e15e6528 Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Tue, 23 Mar 2010 11:46:10 +0000 Subject: Fix implementation of IPv6 TCP distribution protocol TCP distribution over IPv6 did not work. The TCP socket was forcibly closed before any communication could take place. The following changes resolve this: * Make the kernel use the inet6 variant of accept. * Use inet6 variants of TCP socket functions. * Ensure that the inet6 address family is used in all cases. --- lib/kernel/src/inet6_tcp_dist.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/kernel/src/inet6_tcp_dist.erl') diff --git a/lib/kernel/src/inet6_tcp_dist.erl b/lib/kernel/src/inet6_tcp_dist.erl index 34cf582af7..097cadf8d4 100644 --- a/lib/kernel/src/inet6_tcp_dist.erl +++ b/lib/kernel/src/inet6_tcp_dist.erl @@ -87,7 +87,7 @@ accept(Listen) -> accept_loop(Kernel, Listen) -> case inet6_tcp:accept(Listen) of {ok, Socket} -> - Kernel ! {accept,self(),Socket,inet,tcp}, + Kernel ! {accept,self(),Socket,inet6,tcp}, controller(Kernel, Socket), accept_loop(Kernel, Listen); Error -> @@ -236,8 +236,8 @@ do_setup(Kernel, Node, Type, MyNode, LongOrShortNames,SetupTime) -> timer = Timer, this_flags = 0, other_version = Version, - f_send = fun inet_tcp:send/2, - f_recv = fun inet_tcp:recv/3, + f_send = fun inet6_tcp:send/2, + f_recv = fun inet6_tcp:recv/3, f_setopts_pre_nodeup = fun(S) -> inet:setopts @@ -262,7 +262,7 @@ do_setup(Kernel, Node, Type, MyNode, LongOrShortNames,SetupTime) -> address = {Ip,TcpPort}, host = Address, protocol = tcp, - family = inet} + family = inet6} end, mf_tick = fun ?MODULE:tick/1, mf_getstat = fun ?MODULE:getstat/1, -- cgit v1.2.3