Re: Adam Roach's No Objection on draft-ietf-rtgwg-routing-types-16: (with COMMENT)

Adam Roach <adam@nostrum.com> Thu, 12 October 2017 16:13 UTC

Return-Path: <adam@nostrum.com>
X-Original-To: rtgwg@ietfa.amsl.com
Delivered-To: rtgwg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 70A9313453C; Thu, 12 Oct 2017 09:13:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.88
X-Spam-Level:
X-Spam-Status: No, score=-1.88 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, T_SPF_HELO_PERMERROR=0.01, T_SPF_PERMERROR=0.01] 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 pHGzh1gqJhu0; Thu, 12 Oct 2017 09:13:55 -0700 (PDT)
Received: from nostrum.com (raven-v6.nostrum.com [IPv6:2001:470:d:1130::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C2A7013453D; Thu, 12 Oct 2017 09:13:52 -0700 (PDT)
Received: from Orochi.local (99-152-146-228.lightspeed.dllstx.sbcglobal.net [99.152.146.228]) (authenticated bits=0) by nostrum.com (8.15.2/8.15.2) with ESMTPSA id v9CGDZ09088062 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 12 Oct 2017 11:13:36 -0500 (CDT) (envelope-from adam@nostrum.com)
X-Authentication-Warning: raven.nostrum.com: Host 99-152-146-228.lightspeed.dllstx.sbcglobal.net [99.152.146.228] claimed to be Orochi.local
Subject: Re: Adam Roach's No Objection on draft-ietf-rtgwg-routing-types-16: (with COMMENT)
To: "Acee Lindem (acee)" <acee@cisco.com>, The IESG <iesg@ietf.org>
Cc: "draft-ietf-rtgwg-routing-types@ietf.org" <draft-ietf-rtgwg-routing-types@ietf.org>, "rtgwg-chairs@ietf.org" <rtgwg-chairs@ietf.org>, Jeff Tantsura <jefftant.ietf@gmail.com>, "rtgwg@ietf.org" <rtgwg@ietf.org>
References: <150776904011.16844.17501743592969348058.idtracker@ietfa.amsl.com> <D6043959.CE4D1%acee@cisco.com>
From: Adam Roach <adam@nostrum.com>
Message-ID: <2a258e4e-eea6-2ac7-2237-7277b38e1d83@nostrum.com>
Date: Thu, 12 Oct 2017 11:13:30 -0500
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
MIME-Version: 1.0
In-Reply-To: <D6043959.CE4D1%acee@cisco.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtgwg/4IschAaPxD1auCuwholxj6vu6Aw>
X-BeenThere: rtgwg@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Routing Area Working Group <rtgwg.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtgwg>, <mailto:rtgwg-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rtgwg/>
List-Post: <mailto:rtgwg@ietf.org>
List-Help: <mailto:rtgwg-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtgwg>, <mailto:rtgwg-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Oct 2017 16:13:56 -0000

On 10/11/17 20:16, Acee Lindem (acee) wrote:
>
>> ____
>>
>> There are several patterns in the YANG definition that perform significant
>> restriction of numbers (e.g., to ensure they don't fall outside the range
>> that
>> can be stored in 16 or 32 bits). In many cases, these patterns include the
>> ability to zero-prefix some (but not all) decimal values. For example, the
>> production for route-origin would allow leading zeros in "2:0100:0555"
>> but not
>> in "2:04294967295:065535" (even though "2:4294967295:65535" is okay). I
>> don't
>> know offhand whether it makes sense to allow leading zeros in these
>> fields, but
>> I would argue that the production should be consistent in allowing or
>> disallowing them. This issue arises in various forms in route-target,
>> ipv6-route-target, route-origin, and ipv6-route-origin.
> We’ll look at this and get back to you - a lot of time has already gone
> into formulating and testing these patterns.


Yes, and it would be a shame if that work resulted in publishing 
patterns with known issues.

This flaw arises in three formulations (each of which appear multiple 
times), and would be quite easy to fix. These fixes should be obvious by 
inspection.

32 bits (0-4,294,967,295)
   Replace: [0-3]?[0-9]{0,8}[0-9]
   With:    [1-3][0-9]{9}|[1-9][0-9]{0,8}|0

16 bits (0-65535)
   Replace: [0-5]?[0-9]{0,3}[0-9]
   With:    [1-5][0-9]{4}|[1-9][0-9]{0,3}|0

8 bits (0-255)
   Replace: [01]?[0-9]?[0-9]
   With:    1[0-9]{2}|[1-9]?[0-9]

____

As an aside: replacing "[0-9]" with "\d" everywhere would make these 
patterns easier to read in general, but this is merely a readability 
improvement rather than a bug fix. Compare:

          + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
          +     '4294967[01][0-9]{2}|'
          +     '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
          +     '4294[0-8][0-9]{5}|'
          + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
          +     '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
          +     '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
          +     '6[0-4][0-9]{3}|'
          +     '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'

Becomes:

          + '(2:(429496729[0-5]|42949672[0-8]\d|'
          +     '4294967[01]\d{2}|'
          +     '429496[0-6]\d{3}|42949[0-5]\d{4}|'
          +     '4294[0-8]\d{5}|'
          +     '429[0-3]\d{6}|42[0-8]\d{7}|4[01]\d{8}|'
          +     '[1-3]\d{9}|[1-9]\d{0,8}|0):'
          +     '(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|'
          +     '6[0-4]\d{3}|'
          +     '[1-5]\d{4}|[1-9]\d{0,3}|0))|'


/a