NetBSD Problem Report #51669
From he@smistad.uninett.no Tue Nov 29 09:32:23 2016
Return-Path: <he@smistad.uninett.no>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 590B27A2FD
for <gnats-bugs@gnats.NetBSD.org>; Tue, 29 Nov 2016 09:32:23 +0000 (UTC)
Message-Id: <20161129093215.3CCF843EA79@smistad.uninett.no>
Date: Tue, 29 Nov 2016 10:32:15 +0100 (CET)
From: he@uninett.no
Reply-To: he@uninett.no
To: gnats-bugs@NetBSD.org
Subject: hosts.allow syntax for IPv6 literals is ... unclear
X-Send-Pr-Version: 3.95
>Number: 51669
>Category: bin
>Synopsis: hosts.allow syntax for IPv6 literals is ... unclear
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Nov 29 09:35:00 +0000 2016
>Originator: he@uninett.no
>Release: NetBSD 7.0
>Organization:
UNINETT AS
>Environment:
System: NetBSD smistad.uninett.no 7.0 NetBSD 7.0 (GENERIC.201509250726Z) amd64
Architecture: x86_64
Machine: amd64
>Description:
The manual page for hosts.allow on NetBSD has this to say
about how one can specify an address range in IPv6:
o An expression of the form `ipv6-addr/ipv6-mask' is interpreted
as masked IPv6 address match, just like masked IPv4 address
match (see above). Note that `ipv6-mask' portion must always be
specified.
This doesn't quite add up with the implementation, it seems.
First off, the thing behind the / isn't an ipv6-mask, it's a
prefix length. And the implementation only (?) accepts
`[ipv6-net/prefixlen]', and the above does not say that the
brackets are a required part of the syntax.
Furthermore, this also deviates from the syntax used by both
FreeBSD and Linux, which specify `[ipv6-net]/prefixlen',
i.e. the prefixlen is only accepted outside of the brackets.
The FreeBSD man page is a lot clearer on this specific point:
o An expression of the form `[n:n:n:n:n:n:n:n]/m' is interpreted
as a `[net]/prefixlen' pair. A IPv6 host address is matched if
`prefixlen' bits of `net' is equal to the `prefixlen' bits of
the address. For example, the [net]/prefixlen pattern
`[3ffe:505:2:1::]/64' matches every address in the range
`3ffe:505:2:1::' through `3ffe:505:2:1:ffff:ffff:ffff:ffff'.
This appears, modulo an a/an correction, to be identical to
the documentation on Debian Linux as well.
>How-To-Repeat:
Experiment with variations of the above patterns, and see that
you can only do `[ipv6-net/prefixlen]' syntax on NetBSD.
Inspect the man pages of those other projects.
>Fix:
Not supplied here...
There's of course a compatibility issue if we're going to
start accepting '[ipv6-net]/prefixlen' syntax as well, the old
syntax should probably continue to be supported.
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.