Alexander Bluhm(alexander.bl...@gmx.net) on 2019.11.14 22:50:50 +0100:
> Hi,
> 
> While writing my ifconfig regress test I realized that IPv6 netmasks
> are parsed, but silently ignored.  Ignoring commandline parameters
> feels wrong and is inconsistent to IPv4.
> 
> Of course I don't expect anyone to use something like this:
> 
> ifconfig vether0 inet6 fdd7:e83e:66bc:ffff::17 netmask 
> ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff

reminds me of the problems in route.

> But current implementation sets a prefixlen 64 in this case.
> 
> ok?

diff is ok, but ...

The alternative is to not allow netmask for ipv6 and only /<prefixlen> and 
prefixlen
<prefixlen>. Why support such a crazy way of specifying the mask?

In route we removed a few quirks like that with notice in current.html , why 
not here?

Con: Unfortunatly most netmasks configured will be /64, so probability is high
that if someone actually uses netmask, the problem wont be noticed.

> bluhm
> 
> Index: sbin/ifconfig/ifconfig.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/sbin/ifconfig/ifconfig.c,v
> retrieving revision 1.414
> diff -u -p -r1.414 ifconfig.c
> --- sbin/ifconfig/ifconfig.c  24 Oct 2019 18:54:10 -0000      1.414
> +++ sbin/ifconfig/ifconfig.c  14 Nov 2019 21:27:47 -0000
> @@ -1301,6 +1301,7 @@ void
>  setifnetmask(const char *addr, int ignored)
>  {
>       afp->af_getaddr(addr, MASK);
> +     explicit_prefix = 1;
>  }
> 
>  /* ARGSUSED */
> 

Reply via email to