From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 8 12:27:28 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 2887C1065670 for ; Fri, 8 Apr 2011 12:27:28 +0000 (UTC) (envelope-from boogie@lazybytes.org) Received: from mail.lazybytes.org (mail.lazybytes.org [195.54.209.3]) by mx1.freebsd.org (Postfix) with ESMTP id D65048FC17 for ; Fri, 8 Apr 2011 12:27:27 +0000 (UTC) Received: from [95.108.170.237] (dhcp170-237-red.yandex.net [95.108.170.237]) by mail.lazybytes.org (Postfix) with ESMTPSA id 65932546 for ; Fri, 8 Apr 2011 16:08:25 +0400 (MSD) Message-ID: <4D9EFAC6.4020906@lazybytes.org> Date: Fri, 08 Apr 2011 16:08:38 +0400 From: Sergey Vinogradov User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110307 Lanikai/3.1.9 MIME-Version: 1.0 To: FreeBSD Hackers Content-Type: multipart/mixed; boundary="------------090300000608040101010202" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (mail.lazybytes.org); Fri, 08 Apr 2011 16:08:25 +0400 (MSD) Cc: Subject: 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 12:27:28 -0000 This is a multi-part message in MIME format. --------------090300000608040101010202 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 attached patch break something in the very bad way? -- wbr, Boo --------------090300000608040101010202 Content-Type: text/plain; name="af_inet.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="af_inet.c.patch" --- af_inet.c.orig 2011-04-07 18:48:28.850931143 +0400 +++ af_inet.c 2011-04-08 11:45:51.556706573 +0400 @@ -79,7 +79,7 @@ sin = (struct sockaddr_in *)ifa->ifa_netmask; if (sin == NULL) sin = &null_sin; - printf("netmask 0x%lx ", (unsigned long)ntohl(sin->sin_addr.s_addr)); + printf("netmask %s ", inet_ntoa(sin->sin_addr)); if (ifa->ifa_flags & IFF_BROADCAST) { sin = (struct sockaddr_in *)ifa->ifa_broadaddr; --------------090300000608040101010202--