Re: Question about RFC6724

Erik Kline <ek.ietf@gmail.com> Mon, 02 May 2022 04:46 UTC

Return-Path: <ek.ietf@gmail.com>
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 37F6BC157B50 for <ipv6@ietfa.amsl.com>; Sun, 1 May 2022 21:46:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o6iRTDO-YZtg for <ipv6@ietfa.amsl.com>; Sun, 1 May 2022 21:46:51 -0700 (PDT)
Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6F3D4C157B49 for <ipv6@ietf.org>; Sun, 1 May 2022 21:46:51 -0700 (PDT)
Received: by mail-ot1-x329.google.com with SMTP id h10-20020a056830400a00b00605e92cc450so7105164ots.11 for <ipv6@ietf.org>; Sun, 01 May 2022 21:46:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S/Ca5GnT4XROXQdHdNW+Mk/GPg4VMnix2CnWzM2mePY=; b=XhE/UH/V/xg2P1s5KAjcG4i8VFTBVg4YhRSZA2xBWP6kRy5MvynxZggEexu6Ieymdv 1rgoGDTf97KjliFklS0C1CjmINvEOz8X2w5WtnQRG1n1oGWVBMGQ19/u0sDoithibojZ q++H4CxR5Fv9MK1ztNL9wRvu9+v1PF8bEkCV3ANUlWQ7Q9/zAWCB80y0QnNRggmehJwm 6Neo5RkWMlRo4UEo4sy61ciGF4w0PZxK9t/uoAyUfBcMX2rmYHzO2XR/1UH7P4/B/CYF Vfz/7hsq2ZYxlFzTsYYgQztUiCIIL0WkV3Z/FrwIRkddBQ9XvxuFTrbWTHNvmGPVvgHY 6eJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S/Ca5GnT4XROXQdHdNW+Mk/GPg4VMnix2CnWzM2mePY=; b=AuO6b5//FZFOj90aW8U7kb9LghtYj1Z20WzULgr4zh8eyIyxpA/vBjIgg+Cq5bPOli r+Y3pmmL1hqLLFv0LUdJVjuLUtMcZOUQQzy1IH3/sQUABtK3gNkWfRcrHWkAWIFXsplu 1zHfNySwRULrFxJ0TDqP2KSLABYSw3etpefAKqJkYxV7+5NiLzS4UV63i205APhrPsyI +0rWEnFXVzgAp5fy8haBFL2826nfzv9cOjplwInLANiHX++ASSWHPDEnkOGxPTnBW7av ebl+4MOrb6nutbPB7u1C1+9Vo6Fn512WJewc9/ajXVzPEHAkto3o7t5gjClj8DIHPzCf QSQw==
X-Gm-Message-State: AOAM533FhP1pUmDpd/vAPjqZ3mCCd59WhywJIzOClUv3GQLM8EX+0xFj scFlC/fuZVZxaEsfzzOlvpfMcf19cVPKuwjiPug=
X-Google-Smtp-Source: ABdhPJwc6MppbHVFuUWEcX34+H1UXFNyNQSAkkE5W4/Ey3oJZf9ckL4tfZWpGyG65+wpqn7LGAHa3IOQUgt4jw1LJx8=
X-Received: by 2002:a9d:2089:0:b0:605:e8b3:cd7a with SMTP id x9-20020a9d2089000000b00605e8b3cd7amr3578042ota.349.1651466810267; Sun, 01 May 2022 21:46:50 -0700 (PDT)
MIME-Version: 1.0
References: <985e9c94-b6f7-b45d-208d-e9b26664540b@gmail.com>
In-Reply-To: <985e9c94-b6f7-b45d-208d-e9b26664540b@gmail.com>
From: Erik Kline <ek.ietf@gmail.com>
Date: Sun, 01 May 2022 21:46:39 -0700
Message-ID: <CAMGpriX8+_HRLe4g+JRThR-Q=uXt-i3jecVRd3=SXDUg5zYBrA@mail.gmail.com>
Subject: Re: Question about RFC6724
To: Brian E Carpenter <brian.e.carpenter@gmail.com>
Cc: 6man <ipv6@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000959b6405de0014c5"
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipv6/2iNsGk3KZBwkMixoNybFqPzK5Ug>
X-BeenThere: ipv6@ietf.org
X-Mailman-Version: 2.1.34
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, 02 May 2022 04:46:55 -0000

I'm pretty sure for Linux it's just bitwise comparison all the way down.
addrconf.c's "/* Rule 8: Use longest matching prefix */":

    https://github.com/torvalds/linux/blob/master/net/ipv6/addrconf.c#L1622

calls ipv6_addr_diff(), which I think is:

    https://github.com/torvalds/linux/blob/master/include/net/ipv6.h#L761

or the diff64 variant, depending.

On Sun, May 1, 2022 at 9:33 PM Brian E Carpenter <
brian.e.carpenter@gmail.com> wrote:

> Hi,
>
> Excuse my ignorance, but I have a question about RFC6724. The rules depend
> on longest prefix matching and therefore on the definition of
> CommonPrefixLen(S, D).
>
> The way it's defined doesn't work for ::ffff:0:0/96, as far as I can see:
>
> >
> > 2.2.  Common Prefix Length
> >
> >    We define the common prefix length CommonPrefixLen(S, D) of a source
> >    address S and a destination address D as the length of the longest
> >    prefix (looking at the most significant, or leftmost, bits) that the
> >    two addresses have in common, up to the length of S's prefix (i.e.,
> >    the portion of the address not including the interface ID).  For
> >    example, CommonPrefixLen(fe80::1, fe80::2) is 64.
>
> The "interface ID" is simply a non-concept for IPv4-mapped IPv6 addresses.
> So what do implementations do? What is the common prefix length of
> ::ffff:10.1.0.10 and :ffff:10.1.0.1, in terms of the RFC6724 rules?
>
>       Brian
>
> --------------------------------------------------------------------
> IETF IPv6 working group mailing list
> ipv6@ietf.org
> Administrative Requests: https://www.ietf.org/mailman/listinfo/ipv6
> --------------------------------------------------------------------
>