diff options
author | Lukas Larsson <[email protected]> | 2017-05-22 16:21:58 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2017-05-22 16:21:58 +0200 |
commit | 1d6ec21da2d91f4226fb42506299e782ccdb4644 (patch) | |
tree | 2542d1c7377ca8c1e1bd217c2f83c11ad807b876 | |
parent | 05dce0f330c83278cb134c7235a5353ce4116307 (diff) | |
download | otp-1d6ec21da2d91f4226fb42506299e782ccdb4644.tar.gz otp-1d6ec21da2d91f4226fb42506299e782ccdb4644.tar.bz2 otp-1d6ec21da2d91f4226fb42506299e782ccdb4644.zip |
kernel: Skip ipv6 tcs when cpiv6 is disabled
For some reason doing a gen_udp:open(0, [inet6,{ipv6_v6only,true}])
works on some systems where ipv6 is disabled. So instead we
explicitly require the localhost ip to do the test at which seems
to work better.
ipv6 was disabled in sysctl using the line net.ipv6.conf.all.disable_ipv6=1
when this behaviour was found.
-rw-r--r-- | lib/kernel/test/gen_tcp_api_SUITE.erl | 8 | ||||
-rw-r--r-- | lib/kernel/test/gen_udp_SUITE.erl | 4 | ||||
-rw-r--r-- | lib/kernel/test/inet_sockopt_SUITE.erl | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index 92a74465b7..3f11e25b93 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -302,9 +302,9 @@ t_implicit_inet6(Config) when is_list(Config) -> end. t_implicit_inet6(Host, Addr) -> - case gen_tcp:listen(0, [inet6]) of + Loopback = {0,0,0,0,0,0,0,1}, + case gen_tcp:listen(0, [inet6, {ip,Loopback}]) of {ok,S1} -> - Loopback = {0,0,0,0,0,0,0,1}, io:format("~s ~p~n", ["::1",Loopback]), implicit_inet6(S1, Loopback), ok = gen_tcp:close(S1), @@ -524,10 +524,10 @@ local_handshake(S, SAddr, C, CAddr) -> t_accept_inet6_tclass(Config) when is_list(Config) -> TClassOpt = {tclass,8#56 bsl 2}, % Expedited forwarding - case gen_tcp:listen(0, [inet6,TClassOpt]) of + Loopback = {0,0,0,0,0,0,0,1}, + case gen_tcp:listen(0, [inet6, {ip, Loopback}, TClassOpt]) of {ok,L} -> LPort = ok(inet:port(L)), - Loopback = {0,0,0,0,0,0,0,1}, Sa = ok(gen_tcp:connect(Loopback, LPort, [])), Sb = ok(gen_tcp:accept(L)), [TClassOpt] = ok(inet:getopts(Sb, [tclass])), diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index 1029d7ef0a..836e0c5a05 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -717,9 +717,9 @@ implicit_inet6(Config) when is_list(Config) -> implicit_inet6(Host, Addr) -> Active = {active,false}, - case gen_udp:open(0, [inet6,Active]) of + Loopback = {0,0,0,0,0,0,0,1}, + case gen_udp:open(0, [inet6,Active,{ip, Loopback}]) of {ok,S1} -> - Loopback = {0,0,0,0,0,0,0,1}, io:format("~s ~p~n", ["::1",Loopback]), implicit_inet6(S1, Active, Loopback), ok = gen_udp:close(S1), diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl index 322b9f30fe..9413cbd976 100644 --- a/lib/kernel/test/inet_sockopt_SUITE.erl +++ b/lib/kernel/test/inet_sockopt_SUITE.erl @@ -620,7 +620,7 @@ ipv6_v6only_close(Module, Socket) -> %% Test using socket option ipv6_v6only for UDP. use_ipv6_v6only_udp(Config) when is_list(Config) -> - case gen_udp:open(0, [inet6,{ipv6_v6only,true}]) of + case gen_udp:open(0, [inet6,{ip,{0,0,0,0,0,0,0,1}}, {ipv6_v6only,true}]) of {ok,S6} -> case inet:getopts(S6, [ipv6_v6only]) of {ok,[{ipv6_v6only,true}]} -> |