bin/161986: netstat(1): Interface auto-width in " netstat -rn"

Першин Владимир pershin87 at yandex.ru
Wed Nov 9 03:00:31 UTC 2011


The following reply was made to PR bin/161986; it has been noted by GNATS.

From: =?koi8-r?B?8MXS28nOIPfMwcTJzcnS?= <pershin87 at yandex.ru>
To: bug-followup at freebsd.org,dyr at smartspb.net
Cc:  
Subject: Re: bin/161986: netstat(1): Interface auto-width in &quot;netstat -rn&quot;
Date: Wed, 09 Nov 2011 06:56:32 +0400

 I wrote small patch.
 Tested patch on 8.2-RELEASE-p3
 
 --- route.c     2010-12-21 23:09:25.000000000 +0600
 +++ route_n.c   2011-11-04 23:01:33.000000000 +0600
 @@ -264,13 +264,11 @@
  #ifndef INET6
  #define        WID_DST_DEFAULT(af)     18      /* width of destination column */
  #define        WID_GW_DEFAULT(af)      18      /* width of gateway column */
 -#define        WID_IF_DEFAULT(af)      (Wflag ? 8 : 6) /* width of netif column */
  #else
  #define        WID_DST_DEFAULT(af) \
         ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18)
  #define        WID_GW_DEFAULT(af) \
         ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18)
 -#define        WID_IF_DEFAULT(af)      ((af) == AF_INET6 ? 8 : (Wflag ? 8 : 6))
  #endif /*INET6*/
 
  static int wid_dst;
 @@ -291,11 +289,10 @@
         wid_refs = 6;
         wid_use = 8;
         wid_mtu = 6;
 -       wid_if = WID_IF_DEFAULT(ef);
 +       wid_if = 8;
         wid_expire = 6;
 
 -       if (Wflag)
 -               size_cols_tree(rn);
 +       size_cols_tree(rn);
  }
 
  static void
 @@ -781,7 +778,7 @@
                         if (rt->rt_rmx.rmx_mtu != 0)
                                 printf("%*lu ", wid_mtu, rt->rt_rmx.rmx_mtu);
                         else
 -                               printf("%*s ", wid_mtu, "");
 +                               printf("%*s ", wid_mtu, "");
                 }
         }
         if (rt->rt_ifp) {


More information about the freebsd-bugs mailing list