Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Apr 2011 08:53:16 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Sergey Vinogradov <boogie@lazybytes.org>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: ifconfig output: ipv4 netmask format
Message-ID:  <BANLkTimtKiTTc49Aee6a-nfzKyHUoJAGNQ@mail.gmail.com>
In-Reply-To: <4D9F2C88.4010205@lazybytes.org>
References:  <4D9EFAC6.4020906@lazybytes.org> <7EA5889E-77EF-4BAE-9655-C33692A75602@bsdimp.com> <4D9F2C88.4010205@lazybytes.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 8, 2011 at 8:40 AM, Sergey Vinogradov <boogie@lazybytes.org> wr=
ote:
> On 08.04.2011 19:23, Warner Losh wrote:
>>
>> On Apr 8, 2011, at 6:08 AM, Sergey Vinogradov wrote:
>>
>>> Hi, hackers.
>>> I have a question: why ipv4 netmask is displayed by ifconfig in hex
>>> format? Isn't dot-decimal notation more human-readable? Will the attach=
ed
>>> patch break something in the very bad way?
>>
>> This is a gratuitous change that would break scripts. =A0Hex has been us=
ed
>> for a very long time, and most people know how to cope.
>>
>> If we really wanted to make it human readable, we'd output 10.2.3.4/24

Except that developers have to resort to jumping through a few hoops
to get things printed out in a format to pass into other commands that
expect a dot-decimal format.

One thing I've been curious about for a while that I haven't had an
opportunity to look into is: what does IPV6 look like? I understand
that the /netmask bit is added to the end of addresses, but what does
the netmask actually look like?

> So, maybe, while following the POLA, we should add an option, as Daniel
> mentioned above? To output the CIDR?

Eh... I don't know if doing this would be wise because it might break
some 3rd party mechanisms for parsing the output (as broken as you
might think it is), in particular (for example) because people can
alias the ifconfig command to something else.

Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTimtKiTTc49Aee6a-nfzKyHUoJAGNQ>