Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 May 2003 19:47:15 -0400 (EDT)
From:      Mike Tancsa <mike@sentex.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/52349: netstat -ni broken for vlan interfaces
Message-ID:  <200305162347.h4GNlF9H055652@shell1.sentex.ca>
Resent-Message-ID: <200305162350.h4GNoCrd072369@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305162347.h4GNlF9H055652>