On Sun, Jun 24, 2018 at 04:34:01PM +0200, Jeremie Courreges-Anglas wrote:
> 3. ... why should we stop assuming that the user really means to
> configure a route for a /64 if the host id part is all-zeroes? Is
> this really part of what has been deprecated by RFC3587?
>
> I can understand that having the same behavior (host address is no
> prefix length is specified) with v4 and v6 is desirable, but as benno
> pointed out, some people might be relying on the current default
> behavior. That's not a strong objection, but I'd like to know what's
> the exact rationale behind this change.
>
> An alternate way of fixing item 2 would be to keep the current behavior
> but extend it to any foo:bar:: address, not just to addresses within
> 2000::/3.
>
With your diff you break the ULA address space where
route add fc01:db8:: ::1
results in fc01:db8::/64 being inserted instead of the /128 :)
>
> Index: route.c
> ===================================================================
> RCS file: /d/cvs/src/sbin/route/route.c,v
> retrieving revision 1.215
> diff -u -p -p -u -r1.215 route.c
> --- route.c 18 Jun 2018 09:17:06 -0000 1.215
> +++ route.c 24 Jun 2018 14:31:46 -0000
> @@ -792,7 +792,7 @@ inet_makenetandmask(u_int32_t net, struc
> int
> inet6_makenetandmask(struct sockaddr_in6 *sin6, char *plen)
> {
> - struct in6_addr in6;
> + static const struct in6_addr zero_in6;
> const char *errstr;
> int i, len, q, r;
>
> @@ -800,12 +800,9 @@ inet6_makenetandmask(struct sockaddr_in6
> if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) &&
> sin6->sin6_scope_id == 0) {
> plen = "0";
> - } else if ((sin6->sin6_addr.s6_addr[0] & 0xe0) == 0x20) {
> - /* aggregatable global unicast - RFC2374 */
> - memset(&in6, 0, sizeof(in6));
> - if (!memcmp(&sin6->sin6_addr.s6_addr[8],
> - &in6.s6_addr[8], 8))
> - plen = "64";
> + } else if (!memcmp(&sin6->sin6_addr.s6_addr[8],
> + &zero_in6.s6_addr[8], 8)) {
> + plen = "64";
> }
> }
>
>
> --
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
>