From owner-freebsd-current Tue Nov 14 22:05:52 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id WAA19126 for current-outgoing; Tue, 14 Nov 1995 22:05:52 -0800 Received: from jhome.DIALix.COM (root@jhome.DIALix.COM [192.203.228.69]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id WAA18996 for ; Tue, 14 Nov 1995 22:04:58 -0800 Received: (from peter@localhost) by jhome.DIALix.COM (8.6.12/8.6.9) id NAA04769; Wed, 15 Nov 1995 13:57:55 +0800 Date: Wed, 15 Nov 1995 13:57:54 +0800 (WST) From: Peter Wemm To: current@freebsd.org Subject: netstat has been broken for a long time.. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-current@freebsd.org Precedence: bulk Hi all... I thought netstat was deliberately leaving off the unix^H^H^H^Hlocal domain sockets unless a switch was specified. I couldn't find which option it was from the man page, so I looked at the source. To my (not so) great suprise, I discovered netstat was accidently broken... it's nlist()ing the kernel looking for "_unixsw" which was replaced with "_localsw" and netstat not updated. The only problem is that I've grown used to netstat without the unix domain sockets at the bottom. I'm reluctant to fix it for that reason. ....However.... Perhaps it would be an acceptable compromise to fix inetd so that it does not display AF_UNIX sockets unless specifically requested with "netstat -f unix". Best of both worlds? What's the verdict? Is the complete (long) version better? The short one? is "-f unix" an acceptable compromise? (-f is an existing switch). So, the combined patch would become: Index: main.c =================================================================== RCS file: /home/ncvs/src/usr.bin/netstat/main.c,v retrieving revision 1.8 diff -u -r1.8 main.c --- main.c 1995/10/26 20:31:55 1.8 +++ main.c 1995/11/15 05:54:20 @@ -84,7 +84,7 @@ #define N_RTSTAT 9 { "_rtstat" }, #define N_UNIXSW 10 - { "_unixsw" }, + { "_localsw" }, #define N_IDP 11 { "_nspcb"}, #define N_IDPSTAT 12 @@ -414,7 +414,7 @@ if (af == AF_ISO || af == AF_UNSPEC) for (tp = isoprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); - if ((af == AF_UNIX || af == AF_UNSPEC) && !sflag) + if (af == AF_UNIX && !sflag) unixpr(nl[N_UNIXSW].n_value); exit(0); } Opinions? -Peter