From mdtancsa@sentex.net  Fri May 16 16:42:24 2003
Return-Path: <mdtancsa@sentex.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A562537B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 16 May 2003 16:42:24 -0700 (PDT)
Received: from smtp1.sentex.ca (smtp1.sentex.ca [199.212.134.4])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C00C243FAF
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 16 May 2003 16:42:18 -0700 (PDT)
	(envelope-from mdtancsa@sentex.net)
Received: from shell1.sentex.ca (shell1.sentex.ca [199.212.134.3])
	by smtp1.sentex.ca (8.12.9/8.12.9) with ESMTP id h4GNgB4M047317
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 16 May 2003 19:42:11 -0400 (EDT)
	(envelope-from mdtancsa@sentex.net)
Received: from shell1.sentex.ca (localhost [127.0.0.1])
	by shell1.sentex.ca (8.12.9/8.12.8) with ESMTP id h4GNlFnR055653
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 16 May 2003 19:47:15 -0400 (EDT)
	(envelope-from mdtancsa@shell1.sentex.ca)
Received: (from mdtancsa@localhost)
	by shell1.sentex.ca (8.12.9/8.12.8/Submit) id h4GNlF9H055652;
	Fri, 16 May 2003 19:47:15 -0400 (EDT)
	(envelope-from mdtancsa)
Message-Id: <200305162347.h4GNlF9H055652@shell1.sentex.ca>
Date: Fri, 16 May 2003 19:47:15 -0400 (EDT)
From: Mike Tancsa <mike@sentex.net>
Reply-To: Mike Tancsa <mike@sentex.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: netstat -ni broken for vlan interfaces
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52349
>Category:       bin
>Synopsis:       netstat -ni broken for vlan interfaces
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bms
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 16 16:50:12 PDT 2003
>Closed-Date:    Sat Nov 29 18:59:18 PST 2003
>Last-Modified:  Sat Nov 29 18:59:18 PST 2003
>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:

From: "Andrew Thompson" <andy@fud.org.nz>
To: freebsd-gnats-submit@FreeBSD.org
Cc: mike@sentex.net
Subject: Re: bin/52349: netstat -ni broken for vlan interfaces
Date: Wed, 2 Jul 2003 09:14:39 +1200 (NZST)

 Hi,
 
 This additional patch aligns the table header with the changes in the PR.
 
 
 --- 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
 @@ -188,7 +188,7 @@
                 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");

From: Gleb Smirnoff <glebius@cell.sick.ru>
To: Mike Tancsa <mike@sentex.net>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/52349: netstat -ni broken for vlan interfaces
Date: Thu, 21 Aug 2003 17:04:15 +0400

 On Fri, May 16, 2003 at 07:47:15PM -0400, Mike Tancsa wrote:
 M> >Description:
 M> 		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
 
 It is important that not only word "vlan" is affected by this bug. Any long
 interface name is truncated :).
 
 Usually this bug affects large inter-vlan routers with more than 10 vlan ifaces,
 as well as PPP access servers, having more than 100 tun ifaces.
 
 -- 
 Totus tuus, Glebius.
 GLEBIUS-RIPN GLEB-RIPE
Responsible-Changed-From-To: freebsd-bugs->bms 
Responsible-Changed-By: bms 
Responsible-Changed-When: Tue 25 Nov 2003 09:13:00 PST 
Responsible-Changed-Why:  
I'm in hoover up network PRs mode. I'll look into this. 

This looks superficially related to bin/52349. I don't see any reason offhand 
why these shouldn't go in. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52349 
State-Changed-From-To: open->analyzed 
State-Changed-By: bms 
State-Changed-When: Wed 26 Nov 2003 21:40:42 PST 
State-Changed-Why:  
Patch winging its way to re@ as we speak. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52349 
State-Changed-From-To: analyzed->patched 
State-Changed-By: bms 
State-Changed-When: Fri 28 Nov 2003 09:35:11 PST 
State-Changed-Why:  
Committed to -CURRENT, an MFC should be forthcoming. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52349 
State-Changed-From-To: patched->closed 
State-Changed-By: bms 
State-Changed-When: Sat 29 Nov 2003 18:59:06 PST 
State-Changed-Why:  
MFCed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52349 
>Unformatted:
