Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2002 22:26:20 -0600 (CST)
From:      "Scot W. Hetzel" <hetzels@westbend.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/35838: Change to size of WID_IF in usr.bin/netstat/route.c
Message-ID:  <200203130426.g2D4QKB29342@mail.westbend.net>

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


>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:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 12 20:30:00 PST 2002
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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