bin/52349: netstat -ni broken for vlan interfaces

Mike Tancsa mike at sentex.net
Fri May 16 16:50:14 PDT 2003


>Number:         52349
>Category:       bin
>Synopsis:       netstat -ni broken for vlan interfaces
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 16 16:50:12 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Mike Tancsa
>Release:        FreeBSD 4.8-RC i386
>Organization:
>Environment:
System: FreeBSD shell1.sentex.ca 4.8-RC FreeBSD 4.8-RC #0: Tue Mar 4 05:53:50 EST 2003 mdtancsa at shell1.sentex.ca:/usr/obj/usr/src/sys/shell1 i386


	
>Description:
		I noticed that with netstat if you have more than 9 vlan interfaces, you will never see netstat -ni displayed properly as the interface name column is truncated to 6 chars.  e.g. vlan10 will get displayed as vlan1


>How-To-Repeat:
	define more than 10 vlan devices (e.g 11) so that vlan10 gets created.  Look at netstat -ni
>Fix:
Not sure if this is the most correct, but it works

--- if.c        Mon Sep 17 10:35:46 2001
+++ if.c.patched        Fri May 16 19:25:00 2003
@@ -268,7 +268,7 @@
                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("%-15.15s ", "none");
                } else {
@@ -285,7 +285,7 @@
                                    (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");
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list