netstat output issue
Ian FREISLICH
ianf at clue.co.za
Tue Mar 4 04:17:13 PST 2008
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
More information about the freebsd-current
mailing list