Re: Fix IPV6 literal notation?

Nick Hilliard <nick@foobar.org> Mon, 28 December 2020 22:05 UTC

Return-Path: <nick@foobar.org>
X-Original-To: ipv6@ietfa.amsl.com
Delivered-To: ipv6@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5E9AA3A0E52 for <ipv6@ietfa.amsl.com>; Mon, 28 Dec 2020 14:05:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xT7zpaMuMTrx for <ipv6@ietfa.amsl.com>; Mon, 28 Dec 2020 14:05:41 -0800 (PST)
Received: from mail.netability.ie (mail.netability.ie [46.182.8.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 188313A0E50 for <ipv6@ietf.org>; Mon, 28 Dec 2020 14:05:36 -0800 (PST)
X-Envelope-To: ipv6@ietf.org
Received: from crumpet.local (admin.ibn.ie [46.182.8.8]) (authenticated bits=0) by mail.netability.ie (8.16.1/8.16.1) with ESMTPSA id 0BSM5Sii093886 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Dec 2020 22:05:28 GMT (envelope-from nick@foobar.org)
X-Authentication-Warning: cheesecake.ibn.ie: Host admin.ibn.ie [46.182.8.8] claimed to be crumpet.local
Subject: Re: Fix IPV6 literal notation?
To: Brian E Carpenter <brian.e.carpenter@gmail.com>
Cc: Ofer Inbar <cos@aaaaa.org>, 6man <ipv6@ietf.org>, Tim Bray <tbray@textuality.com>
References: <CAHBU6isQNkE0tmsn7v41Vptgf2OCTQ61gwMKDN4hmK4pBY-J9w@mail.gmail.com> <d244ee54-5f5c-b3e9-bc98-15d59e4ecbe9@gmail.com> <20201228185754.GO2544@miplet.aaaaa.org> <20e22378-e8ae-f20e-8667-664b8bc67e09@gmail.com>
From: Nick Hilliard <nick@foobar.org>
Message-ID: <97e1f92e-37b2-24bd-3236-794bfcb04144@foobar.org>
Date: Mon, 28 Dec 2020 22:05:26 +0000
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:52.0) Gecko/20100101 PostboxApp/7.0.42
MIME-Version: 1.0
In-Reply-To: <20e22378-e8ae-f20e-8667-664b8bc67e09@gmail.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipv6/N_-gwV-q1VDj1nDN9-g6L1-JCJo>
X-BeenThere: ipv6@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "IPv6 Maintenance Working Group \(6man\)" <ipv6.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipv6>, <mailto:ipv6-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipv6/>
List-Post: <mailto:ipv6@ietf.org>
List-Help: <mailto:ipv6-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipv6>, <mailto:ipv6-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 28 Dec 2020 22:05:44 -0000

Brian E Carpenter wrote on 28/12/2020 20:44:
> I think that's really not needed. As a matter of curiosity, I think
> the IPv4 format is pretty much undocumented. A few minutes of research
> found this:
> 
>     One commonly used notation for internet host addresses divides the
>     32-bit address into four 8-bit fields and specifies the value of each
>     field as a decimal number with the fields separated by periods.  This
>     is called the "dotted decimal" notation.  For example, the internet
>     address of ISIF in dotted decimal is 010.002.000.052, or 10.2.0.52.
> 
> which first appeared in RFC820 (January 1983) and last appeared in
> RFC990 (November 1986). Note that leading zeroes are allowed and do not
> signal octal.

it's not unprecedented that programs emit or expect leading zeros when 
dealing with dotted decimal ipv4 notation. You tend to get this quite a 
bit with embedded ip stacks, e.g. rom monitors, bootloaders, PXE 
front-ends, etc.

Obviously this conflicts with the behaviour that you'll see in 
bsd-derived parsers, so in general it's a bad idea to use leading zeros. 
  The same thing applies to using dotted hex, mixing octal/decimal/hex 
format, and partial/complete non-dotted format. Sometimes addresses 
written in these formats will do what you intend, but depending on 
consistent interpretation would be brave, to say the least.

Nick