From admin@mail.westbend.net  Tue Mar 12 20:26:22 2002
Return-Path: <admin@mail.westbend.net>
Received: from mail.westbend.net (ns1.westbend.net [216.47.253.3])
	by hub.freebsd.org (Postfix) with ESMTP id 3ED0B37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 12 Mar 2002 20:26:21 -0800 (PST)
Received: (from root@localhost)
	by mail.westbend.net (8.11.6/8.11.6) id g2D4QKB29342;
	Tue, 12 Mar 2002 22:26:20 -0600 (CST)
	(envelope-from admin)
Message-Id: <200203130426.g2D4QKB29342@mail.westbend.net>
Date: Tue, 12 Mar 2002 22:26:20 -0600 (CST)
From: "Scot W. Hetzel" <hetzels@westbend.net>
Reply-To: "Scot W. Hetzel" <hetzels@westbend.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Change to size of WID_IF in usr.bin/netstat/route.c
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         35838
>Category:       bin
>Synopsis:       Change to size of WID_IF in usr.bin/netstat/route.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bms
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 12 20:30:00 PST 2002
>Closed-Date:    Sat Nov 29 18:59:33 PST 2003
>Last-Modified:  Sat Nov 29 18:59:33 PST 2003
>Originator:     Scot W. Hetzel
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
West Bend Internet
>Environment:
System: FreeBSD mail.westbend.net 4.5-STABLE FreeBSD 4.5-STABLE #1: Thu Mar 7 11:41:02 CST 2002 root@wbiW009.westbend.net:/usr/obj/usr/src/sys/GENERIC i386


>Description:
With an ET/5025PQ Quad T1 card installed in a 4.5-STABLE server (configured
for frame relay), the output of netstat -r shows that the interface name is
truncated:

ns0# netstat -rn | head -n 8
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            10.0.0.1           UGSc    24533   210882   fxp0
10.0.1.220/30      10.0.1.222         Uc          0        0 etha73
127                lo0                UScB        0        0    lo0
127.0.0.1          127.0.0.1          UH          2       14    lo0

etha73 is suppossed to be etha736.  Currently, the -W flag to netstat doesn't
increase this column's width.

>How-To-Repeat:

>Fix:

With the below patch, the output of netstat -rnW is:

ns0# netstat -rnW | head -n 8
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use    Mtu    Netif Expire
default            10.0.0.1           UGSc    24535   210884   1500     fxp0
10.0.1.220/30      10.0.1.222         Uc          0        0   1500  etha736
127                lo0                UScB        0        0  16384      lo0
127.0.0.1          127.0.0.1          UH          2       14  16384      lo0

Could this change be made to CURRENT, and MFC'd to STABLE?

Index: route.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/netstat/route.c,v
retrieving revision 1.41.2.11
diff -u -r1.41.2.11 route.c
--- route.c	18 Oct 2001 10:33:25 -0000	1.41.2.11
+++ route.c	13 Mar 2002 03:38:03 -0000
@@ -225,13 +225,13 @@
 #ifndef INET6
 #define	WID_DST(af) 	18	/* width of destination column */
 #define	WID_GW(af)	18	/* width of gateway column */
-#define	WID_IF(af)	6	/* width of netif column */
+#define	WID_IF(af)	(Wflag ? 8 : 6)	/* width of netif column */
 #else
 #define	WID_DST(af) \
 	((af) == AF_INET6 ? (Wflag ? 39 : (numeric_addr ? 33: 18)) : 18)
 #define	WID_GW(af) \
 	((af) == AF_INET6 ? (Wflag ? 31 : (numeric_addr ? 29 : 18)) : 18)
-#define	WID_IF(af)	((af) == AF_INET6 ? 8 : 6)
+#define	WID_IF(af)	((af) == AF_INET6 ? 8 : (Wflag ? 8 : 6))
 #endif /*INET6*/
 
 /*
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bms 
Responsible-Changed-By: bms 
Responsible-Changed-When: Tue 25 Nov 2003 08:44:21 PST 
Responsible-Changed-Why:  
I'm in hoover up network PRs mode. I'll look into this. 

This sounds like a relatively minor nit, I may commit this with fixups. 

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

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

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

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