netstat

From: Andrew Thompson <andy_at_fud.org.nz>
Date: 01 Jul 2003 22:45:11 +1200
Hi,


Is there any reason that the interface name in netstat is truncated at 5
chars? I have a box with ~100 vlans so the interface name gets chopped
after vlan9.

Here is a patch to increase it to 7 chars. Any probs?


thanks,

Andy



--- usr.bin/netstat/if.c.orig   Tue Jul  1 22:37:14 2003
+++ usr.bin/netstat/if.c        Tue Jul  1 22:38:59 2003
_at__at_ -188,7 +188,7 _at__at_
                return;
  
        if (!pfunc) {
-               printf("%-5.5s %5.5s %-13.13s %-17.17s %8.8s %5.5s",
+               printf("%-7.7s %5.5s %-13.13s %-17.17s %8.8s %5.5s",
                       "Name", "Mtu", "Network", "Address", "Ipkts",
"Ierrs");
                if (bflag)
                        printf(" %10.10s","Ibytes");
_at__at_ -254,7 +254,7 _at__at_
                drops = ifnet.if_snd.ifq_drops;
  
                if (ifaddraddr == 0) {
-                       printf("%-5.5s %5lu ", name, ifnet.if_mtu);
+                       printf("%-7.7s %5lu ", name, ifnet.if_mtu);
                        printf("%-13.13s ", "none");
                        printf("%-17.17s ", "none");
                } else {
_at__at_ -271,7 +271,7 _at__at_
                                    (u_long)TAILQ_NEXT(&ifaddr.ifa,
ifa_link);
                                continue;
                        }
-                       printf("%-5.5s %5lu ", name, ifnet.if_mtu);
+                       printf("%-7.7s %5lu ", name, ifnet.if_mtu);
                        switch (sa->sa_family) {
                        case AF_UNSPEC:
                                printf("%-13.13s ", "none");
Received on Tue Jul 01 2003 - 01:45:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:13 UTC