From 33ed2e24a516e1024fa984a96ddab90a01a97475 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Wed, 7 Jun 2017 10:10:39 +0200 Subject: 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. --- lib/kernel/src/inet_parse.erl | 6 ------ 1 file changed, 6 deletions(-) (limited to 'lib/kernel/src') 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), []); -- cgit v1.2.3