aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2017-06-07 10:10:39 +0200
committerRaimo Niskanen <[email protected]>2017-06-07 15:36:20 +0200
commit33ed2e24a516e1024fa984a96ddab90a01a97475 (patch)
tree8338da752c18b5614039dd83ae2dd81468c79bcb /lib
parent95ebfa0b19bd4b1cac8a0eb98e775517ebb2ca6d (diff)
downloadotp-33ed2e24a516e1024fa984a96ddab90a01a97475.tar.gz
otp-33ed2e24a516e1024fa984a96ddab90a01a97475.tar.bz2
otp-33ed2e24a516e1024fa984a96ddab90a01a97475.zip
Adjust inet:ntoa/1 to RFC5952, but not deeper
There are a multitude of RFC:s that point to each other and some of them suggest different addresses with IPv4 suffixes. Use the IPv4 suffix text representation only for the old well known ::a.b.c.d and ::ffff:a.b.c.d prefixes. The others seems to be moving targets.
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/src/inet_parse.erl6
-rw-r--r--lib/kernel/test/inet_SUITE.erl2
2 files changed, 0 insertions, 8 deletions
diff --git a/lib/kernel/src/inet_parse.erl b/lib/kernel/src/inet_parse.erl
index f150521e92..06e1048afe 100644
--- a/lib/kernel/src/inet_parse.erl
+++ b/lib/kernel/src/inet_parse.erl
@@ -715,12 +715,6 @@ ntoa({0,0,0,0,0,0,A,B}) -> "::" ++ dig_to_dec(A) ++ "." ++ dig_to_dec(B);
%% IPV4 non ipv6 host address
ntoa({0,0,0,0,0,16#ffff,A,B}) ->
"::ffff:" ++ dig_to_dec(A) ++ "." ++ dig_to_dec(B);
-%% RFC 2765 IPv4-translated address
-ntoa({0,0,0,0,16#ffff,0,A,B}) ->
- "::ffff:0:" ++ dig_to_dec(A) ++ "." ++ dig_to_dec(B);
-%% RFC 6052 Well-known Prefix address
-ntoa({16#64,16#ff9b,0,0,0,0,A,B}) ->
- "64:ff9b::" ++ dig_to_dec(A) ++ "." ++ dig_to_dec(B);
ntoa({_,_,_,_,_,_,_,_}=T) ->
%% Find longest sequence of zeros, at least 2, to replace with "::"
ntoa(tuple_to_list(T), []);
diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl
index 1d4efe17a5..bd842da4b3 100644
--- a/lib/kernel/test/inet_SUITE.erl
+++ b/lib/kernel/test/inet_SUITE.erl
@@ -552,8 +552,6 @@ parse_address(Config) when is_list(Config) ->
tl(V4Reversable),
{P,Q} <-
[{[0,0,0,0,0,16#ffff],"::ffff:"},
- {[0,0,0,0,16#ffff,0],"::ffff:0:"},
- {[16#64,16#ff9b,0,0,0,0],"64:ff9b::"},
{[0,0,0,0,0,0],"::"}]]],
V4Sloppy =
[{{10,1,16#98,16#76},"10.0x019876"},