On Mon, Nov 18, 2019 at 12:04:47PM -0700, Theo de Raadt wrote:
> > As our ifconfig(8) man page says we support it, and route(8) also
> > supports it, I prefer fixing inet6 netmask.
>
> accepting a netmask also requires thinking about the behaviour in the
> discontig case (surely that means detecting and preventing it).

I saw this check for inet netmask in ifconfig.  Setting the inet
route also prevents such an address in the kernel.  But if I remove
all userland checks and use old SIOCSIFNETMASK interface I get

        inet 10.188.254.74 netmask 0xffffff40 broadcast 10.255.255.255

For inet6 in6_mask2len() does the check within the kernel.

/sbin/ifconfig vether99 inet6 fdd7:e83e:66bc:254::74 netmask 
ffff:ffff:ffff:ffff:ffff:4000::
ifconfig: SIOCAIFADDR: Invalid argument

It should be checked early in the kernel for both families.

bluhm

Reply via email to