NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/47704: netstat ignores L option



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

From: Takahiro HAYASHI <t.hash425%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost, netbsd-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/47704: netstat ignores L option
Date: Wed, 12 Nov 2014 12:00:00 +0900

 Patch updated: sync with current netstat/route changes
 
 Index: src/sbin/route/rtutil.c
 ===================================================================
 RCS file: /cvsroot/src/sbin/route/rtutil.c,v
 retrieving revision 1.2
 diff -u -p -r1.2 rtutil.c
 --- src/sbin/route/rtutil.c	8 Nov 2014 00:47:32 -0000	1.2
 +++ src/sbin/route/rtutil.c	8 Nov 2014 02:47:14 -0000
 @@ -261,6 +261,9 @@ p_rtentry(struct rt_msghdr *rtm, int fla
   	char		 ifbuf[IF_NAMESIZE];
   #endif
   
 +	if ((flags & RT_LFLAG) && (rtm->rtm_flags & RTF_LLINFO))
 +		return;
 +
   	if (old_af != sa->sa_family) {
   		old_af = sa->sa_family;
   		p_family(sa->sa_family);
 Index: src/sbin/route/rtutil.h
 ===================================================================
 RCS file: /cvsroot/src/sbin/route/rtutil.h,v
 retrieving revision 1.1
 diff -u -p -r1.1 rtutil.h
 --- src/sbin/route/rtutil.h	6 Nov 2014 21:29:32 -0000	1.1
 +++ src/sbin/route/rtutil.h	8 Nov 2014 02:47:14 -0000
 @@ -34,6 +34,7 @@
   #define RT_TFLAG	2
   #define RT_VFLAG	4
   #define RT_NFLAG	8
 +#define RT_LFLAG	__BIT(4)	/* don't show LLINFO entries */
   
   void p_rttables(int, int, int, int);
   void p_rthdr(int, int);
 Index: src/usr.bin/netstat/main.c
 ===================================================================
 RCS file: /cvsroot/src/usr.bin/netstat/main.c,v
 retrieving revision 1.94
 diff -u -p -r1.94 main.c
 --- src/usr.bin/netstat/main.c	7 Nov 2014 12:42:27 -0000	1.94
 +++ src/usr.bin/netstat/main.c	8 Nov 2014 02:47:14 -0000
 @@ -454,7 +454,7 @@ main(int argc, char *argv[])
   			iflag = 1;
   			break;
   		case 'L':
 -			Lflag = 1;
 +			Lflag = RT_LFLAG;
   			break;
   		case 'l':
   			lflag = 1;
 @@ -639,7 +639,7 @@ main(int argc, char *argv[])
   			else {
   				if (use_sysctl)
   					p_rttables(af,
 -					    nflag|tagflag|vflag, 0, ~0);
 +					    nflag|tagflag|vflag|Lflag, 0, ~0);
   				else
   					routepr(nl[N_RTREE].n_value);
   			}
 
 
 Regards,
 -- 
 t-hash
 


Home | Main Index | Thread Index | Old Index