From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 8 15:53:16 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCDF91065670 for ; Fri, 8 Apr 2011 15:53:16 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id B22768FC13 for ; Fri, 8 Apr 2011 15:53:16 +0000 (UTC) Received: by pvg11 with SMTP id 11so1669901pvg.13 for ; Fri, 08 Apr 2011 08:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=LH9eo6+sP13H5M9aVYM0XKv+FsOeTsZ1GKcvXOn40k0=; b=scOYVRMWH/QD5es5xOvpWZa/jTIqPeqqMMtNQw5iAckqcvpPJ0AS9Dh3blff57VREf wDZtDgglV4IjFA1V0+IJww7VdGIL77bY2hzLM3tf+ahKNTcQpU5EgtBaerGYobPNmM09 dEf1AaHCMB5DqypMriUbzgweZYbM+7ZNL6PYM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Cs6piRQ/WNADLuerSV1OsEbK/uNx5G/+wut+XQi2t2LsUtn2JHw9Q4eQ1IuAq2n9Yj 08mxAcj/2JOJQHmAbFI5UikGX7sPFp7VhxFy6+6x+lFRSU/KPaqs9phKIgGVMCJOHQ7k YbBnrtcakquPxwXrB7MFLpONxcalqVxuLbNAw= MIME-Version: 1.0 Received: by 10.142.248.21 with SMTP id v21mr1905515wfh.56.1302277996107; Fri, 08 Apr 2011 08:53:16 -0700 (PDT) Received: by 10.68.42.3 with HTTP; Fri, 8 Apr 2011 08:53:16 -0700 (PDT) In-Reply-To: <4D9F2C88.4010205@lazybytes.org> References: <4D9EFAC6.4020906@lazybytes.org> <7EA5889E-77EF-4BAE-9655-C33692A75602@bsdimp.com> <4D9F2C88.4010205@lazybytes.org> Date: Fri, 8 Apr 2011 08:53:16 -0700 Message-ID: From: Garrett Cooper To: Sergey Vinogradov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Hackers Subject: Re: ifconfig output: ipv4 netmask format X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2011 15:53:16 -0000 On Fri, Apr 8, 2011 at 8:40 AM, Sergey Vinogradov 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