diff options
author | John-Mark Bell <john-mark.bell@tandberg.com> | 2010-03-23 12:10:00 +0000 |
---|---|---|
committer | Björn Gustavsson <bjorn@erlang.org> | 2010-04-13 13:51:52 +0200 |
commit | 89a89441d0dab3e451fcadec5f2151b4d5ca794f (patch) | |
tree | 2dbcbf20125eded6e513c7903acde5c224abae72 /lib/kernel/src/inet6_tcp_dist.erl | |
parent | 3c1f8435a9032667e207d92d21777612e15e6528 (diff) | |
download | otp-89a89441d0dab3e451fcadec5f2151b4d5ca794f.tar.gz otp-89a89441d0dab3e451fcadec5f2151b4d5ca794f.tar.bz2 otp-89a89441d0dab3e451fcadec5f2151b4d5ca794f.zip |
Support IPv6 addresses in long host names
When distributing over IPv4, node@<IPv4-address>
(e.g. node@127.0.0.1) works correctly.
Permit node@<IPv6-address> (e.g. node@::1) when
distributing over IPv6.
Diffstat (limited to 'lib/kernel/src/inet6_tcp_dist.erl')
-rw-r--r-- | lib/kernel/src/inet6_tcp_dist.erl | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/kernel/src/inet6_tcp_dist.erl b/lib/kernel/src/inet6_tcp_dist.erl index 097cadf8d4..9faee74eda 100644 --- a/lib/kernel/src/inet6_tcp_dist.erl +++ b/lib/kernel/src/inet6_tcp_dist.erl @@ -302,12 +302,17 @@ splitnode(Node, LongOrShortNames) -> Host = lists:append(Tail), case split_node(Host, $., []) of [_] when LongOrShortNames =:= longnames -> - error_msg("** System running to use " - "fully qualified " - "hostnames **~n" - "** Hostname ~s is illegal **~n", - [Host]), - ?shutdown(Node); + case inet_parse:ipv6strict_address(Host) of + {ok, _} -> + [Name, Host]; + _ -> + error_msg("** System running to use " + "fully qualified " + "hostnames **~n" + "** Hostname ~s is illegal **~n", + [Host]), + ?shutdown(Node) + end; L when length(L) > 1, LongOrShortNames =:= shortnames -> error_msg("** System NOT running to use fully qualified " "hostnames **~n" |