Re: A problem with RFC 6465's Uniform Format for Extension Headers

Brian E Carpenter <brian.e.carpenter@gmail.com> Mon, 03 February 2014 23:09 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: ipv6@ietfa.amsl.com
Delivered-To: ipv6@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8F7B01A026A for <ipv6@ietfa.amsl.com>; Mon, 3 Feb 2014 15:09:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham
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 k2pbniY__aly for <ipv6@ietfa.amsl.com>; Mon, 3 Feb 2014 15:09:44 -0800 (PST)
Received: from mail-pb0-x235.google.com (mail-pb0-x235.google.com [IPv6:2607:f8b0:400e:c01::235]) by ietfa.amsl.com (Postfix) with ESMTP id 1EF591A0265 for <6man@ietf.org>; Mon, 3 Feb 2014 15:09:44 -0800 (PST)
Received: by mail-pb0-f53.google.com with SMTP id md12so7633471pbc.40 for <6man@ietf.org>; Mon, 03 Feb 2014 15:09:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:organization:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=JzEjAaD/llHsajD1pZjq00XMtXTn3XpMOYYJCEUpqzg=; b=b4xwO04xoWk1aAaYNAclDo43Uc6N3TQlwEPYahoeI6RSdf8DbrBhDNdILePl8epArn C9nIw4cH9No0r6qvVI9KtM2cQjZXEoHvb7PbCGONNqo7nOikQD3F2Z+5whyT5hGXqFo+ 9nqPeyubIO0K1UIWR8XpV3iUwPvDRVTboWHem9jOoNR/lYjuAc/FNMl44dL4z4ObCkJ7 2I8Gwo+zH0oG5h9hATmJ6dH0RNNWRMI/AlwYz2nIEywv23c3tdRMi/y18EgX6cCky2FK E61ZnBSPvKijpCu7QWh6jGl7ailAHBstXQLJP9wCfZduaygX0Tcu+5SoKCyOK3dQIUBF jmGQ==
X-Received: by 10.68.114.163 with SMTP id jh3mr39381853pbb.99.1391468984085; Mon, 03 Feb 2014 15:09:44 -0800 (PST)
Received: from [130.216.38.108] (sc-cs-567-laptop.cs.auckland.ac.nz. [130.216.38.108]) by mx.google.com with ESMTPSA id ac5sm30305833pbc.37.2014.02.03.15.09.40 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Feb 2014 15:09:42 -0800 (PST)
Message-ID: <52F021B4.20003@gmail.com>
Date: Tue, 04 Feb 2014 12:09:40 +1300
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Organization: University of Auckland
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
To: Hagen Paul Pfeifer <hagen@jauu.net>
Subject: Re: A problem with RFC 6465's Uniform Format for Extension Headers
References: <20140130230740.25350.9524.idtracker@ietfa.amsl.com> <52EAF63A.7050108@si6networks.com> <20140203204716.GD1519@virgo.local> <52F00D8C.8060501@gmail.com> <20140203220028.GA7123@virgo.local>
In-Reply-To: <20140203220028.GA7123@virgo.local>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Cc: "C. M. Heard" <heard@pobox.com>, Fernando Gont <fgont@si6networks.com>, "6man@ietf.org" <6man@ietf.org>
X-BeenThere: ipv6@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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, 03 Feb 2014 23:09:46 -0000

On 04/02/2014 11:00, Hagen Paul Pfeifer wrote:
> * Brian E Carpenter | 2014-02-04 10:43:40 [+1300]:
> 
>> Either solution works, but the firewall implementors might
>> have a preference one way or the other. RFC 7045 says
>> "Therefore, it is important that forwarding
>> nodes that inspect IPv6 headers be able to parse all defined
>> extension headers and deal with them appropriately,..."
>> So the question is whether they would find a reserved
>> range or a subtype easier to parse.
> 
> In the appendix of draft-pfeifer-6man-exthdr-res-01 I provided a patch against
> Linux net-next-2.6 (see end of this email). In the end the compare do not
> matter that match because one additional cmp is used which is fast.

By the way, your code extract seems to show exactly the problem
that inspired RFC 7045: the list of nexthdrs needs to include
all of them as per the new registry at
http://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml#extension-header

    Brian

> 
> 
> 
> diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c
> index 14ed0a9..d7f2e97 100644
> --- a/net/ipv6/exthdrs_core.c
> +++ b/net/ipv6/exthdrs_core.c
> @@ -4,6 +4,9 @@
>   */
>  #include <net/ipv6.h>
> 
> +#define        IP6_EXTHDR_RESERVED_MIN 245
> +#define        IP6_EXTHDR_RESERVED_MAX 252
> +
>  /*
>   * find out if nxthdr is a well-known extension header or a protocol
>   */
> @@ -18,7 +21,8 @@ int ipv6_ext_hdr(u8 nexthdr)
>                  (nexthdr == NEXTHDR_FRAGMENT)  ||
>                  (nexthdr == NEXTHDR_AUTH)      ||
>                  (nexthdr == NEXTHDR_NONE)      ||
> -                (nexthdr == NEXTHDR_DEST);
> +                (nexthdr == NEXTHDR_DEST)      ||
> +                (nexthdr >= IP6_EXTHDR_RESERVED_MIN &&
> +                 nexthdr <= IP6_EXTHDR_RESERVED_MAX);
>  }