On Tue, Dec 13, 2016 at 10:58:28AM +0100, Mark Kettenis wrote:
> > Date: Tue, 13 Dec 2016 10:51:40 +0100
> > From: Reyk Floeter <r...@openbsd.org>
> > 
> > Hi,
> > 
> > printing the netmask in hex seems to be a historical artifact in ifconfig;
> > I always wondered about it and I never got used to it.
> > 
> > The following diff changes ifconfig output to print contiguous
> > netmasks in CIDR notation.  Non-contiguous netmasks will still be
> > printed in full, tunnels will print explicit "prefixlen" because it is
> > not unambiguous where the mask belongs to in this case.
> > 
> > lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> rdomain 1 mtu 32768
> >         index 7 priority 0 llprio 3
> >         groups: lo
> >         inet6 ::1/128
> >         inet6 fe80::1%lo1/64 scopeid 0x7
> >         inet 10.2.1.100 netmask 0xffff00ff
> >         inet 10.3.100.1/24
> > 
> > A similar change has been done in NetBSD and FreeBSD is doing the
> > FreeBSD thing by providing an -f command-line button to select one of
> > three output modes ...
> > 
> > Thoughts?
> 
> I'd say it is a bad idea to mix the two forms in ifconfig output.

What mix?  It is always using CIDR unless it is the really rare case
of a non-contiguous netmask that might be used by 0 to 4 people.

Furthermore,

- On the input side, we already support CIDR, netmask and prefixlen.

- "route" displays CIDR, pf and almost all other configurations use it.

- Almost every other tool uses CIDR or at least dotted-quad netmasks,
the hex format is something that is used almost nowhere else.

Reyk

Reply via email to