Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Mar 2008 14:16:31 +0200
From:      Ian FREISLICH <ianf@clue.co.za>
To:        Peter Jeremy <peterjeremy@optushome.com.au>
Cc:        Barney Cordoba <barney_cordoba@yahoo.com>, current@freebsd.org
Subject:   Re: netstat output issue 
Message-ID:  <E1JWW4N-00013Q-UN@clue.co.za>
In-Reply-To: Message from Peter Jeremy <peterjeremy@optushome.com.au> of "Fri, 29 Feb 2008 17:58:35 %2B1100." <20080229065835.GR83599@server.vk2pj.dyndns.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Jeremy wrote:
> 
> --IjNIXuzrMEaOuFwn
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
> 
> On Thu, Feb 28, 2008 at 02:18:45PM -0800, Barney Cordoba wrote:
> >When using bridging, netstat apparently can only
> >display 5 characters, so "bridge" is shown as the
> >route.
> 
> If you're talking about 'netstat -i', try 'netstat -iW'.

'-W' is marginally better, but in reality "wider" is only really 2
characters wider:

[firewall2.cpt1] ~ $ netstat -iWI vlan2001_vrrp
Name      Mtu Network       Address              Ipkts Ierrs    Opkts Oerrs  Coll
vlan200  1500 <Link#15>                              1     0  2699257     1     0
vlan200  1500 xxx.xx.xx.xx/ xxx.xx.xx.xx        182642     -        0     -     -

It will help Barney, but it doesn't always help.

This patch helps my situation for the '-i' case:

RCS file: /home/ncvs/src/usr.bin/netstat/if.c,v
retrieving revision 1.69
diff -u -d -r1.69 if.c
--- if.c        16 Jul 2007 17:15:54 -0000      1.69
+++ if.c        4 Mar 2008 12:13:48 -0000
@@ -222,7 +222,7 @@
 
        if (!pfunc) {
                if (Wflag)
-                       printf("%-7.7s", "Name");
+                       printf("%-13.13s", "Name");
                else
                        printf("%-5.5s", "Name");
                printf(" %5.5s %-13.13s %-17.17s %8.8s %5.5s",
@@ -291,7 +291,7 @@
 
                if (ifaddraddr == 0) {
                        if (Wflag)
-                               printf("%-7.7s", name);
+                               printf("%-13.13s", name);
                        else
                                printf("%-5.5s", name);
                        printf(" %5lu ", ifnet.if_mtu);
@@ -312,7 +312,7 @@
                                continue;
                        }
                        if (Wflag)
-                               printf("%-7.7s", name);
+                               printf("%-13.13s", name);
                        else
                                printf("%-5.5s", name);
                        printf(" %5lu ", ifnet.if_mtu);


--
Ian Freislich




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1JWW4N-00013Q-UN>