Date: Fri, 08 Apr 2011 16:08:38 +0400 From: Sergey Vinogradov <boogie@lazybytes.org> To: FreeBSD Hackers <freebsd-hackers@FreeBSD.org> Subject: ifconfig output: ipv4 netmask format Message-ID: <4D9EFAC6.4020906@lazybytes.org>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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
[-- Attachment #2 --]
--- 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D9EFAC6.4020906>
