RFC Errata
RFC 6724, "Default Address Selection for Internet Protocol Version 6 (IPv6)", September 2012
Source of RFC: 6man (int)
Errata ID: 6971
Status: Reported
Type: Technical
Publication Format(s) : TEXT
Reported By: Brian Carpenter
Date Reported: 2022-05-10
Section 2.2 says:
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.
It should say:
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., for most IPv6 addresses, the portion of the address not including the interface ID). For example, CommonPrefixLen(fe80::1, fe80::2) is 64. For two IPv4-mapped addresses in ::ffff:0:0/96, CommonPrefixLen() may be up to 128.
Notes:
1) Not all IPv6 address formats have a well-defined interface index.
2) In particular, the original text is inapplicable to IPv4-mapped addresses.
3) N.B.: In practice it seems that some implementations simply do a longest match up to /128 and that works fine.