From owner-freebsd-bugs@FreeBSD.ORG Wed Aug 12 06:00:19 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD0041065672 for ; Wed, 12 Aug 2009 06:00:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A2FB08FC43 for ; Wed, 12 Aug 2009 06:00:19 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7C60I2O060223 for ; Wed, 12 Aug 2009 06:00:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7C60IeC060222; Wed, 12 Aug 2009 06:00:18 GMT (envelope-from gnats) Date: Wed, 12 Aug 2009 06:00:18 GMT Message-Id: <200908120600.n7C60IeC060222@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Joshua Piccari Cc: Subject: Re: kern/81273: [request] remove dependency of tool 'netstat' on 'device mem' in the kernel X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Joshua Piccari List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 06:00:20 -0000 The following reply was made to PR kern/81273; it has been noted by GNATS. From: Joshua Piccari To: bug-followup@FreeBSD.org, bdluevel@heitec.net Cc: Subject: Re: kern/81273: [request] remove dependency of tool 'netstat' on 'device mem' in the kernel Date: Tue, 11 Aug 2009 22:23:25 -0700 --0016e64601f4b902790470eb048d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit This PR looks rather old and seems that most of the work has been done. However, I noticed that there is still an error, which can be removed by removing the kread() call in the diff below. Can someone give advice? I tracked the inclusion of this seemingly extra call in revision 1.86 of main.c in netstat. Looking at the arguments that are passed, it seem it was only used to verify that kvm was available or not. Here is possible patch. Index: usr.bin/netstat/main.c =================================================================== --- usr.bin/netstat/main.c (revision 196109) +++ usr.bin/netstat/main.c (working copy) @@ -530,7 +530,6 @@ * used for the queries, which is slower. */ #endif - kread(0, NULL, 0); if (iflag && !sflag) { intpr(interval, nl[N_IFNET].n_value, NULL); exit(0); Joshua A Piccari /dv/ --0016e64601f4b902790470eb048d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This PR looks rather old and seems that most of the work has been done. How= ever, I noticed that there is still an error, which can be removed by remov= ing the kread() call in the diff below. Can someone give advice? I tracked = the inclusion of this seemingly extra call in revision 1.86 of main.c in ne= tstat. Looking at the arguments that are passed, it seem it was only used t= o verify that kvm was available or not. Here is possible patch.

Index: usr.bin/netstat/main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D
--- usr.bin/netstat/main.c=C2=A0=C2=A0=C2=A0 (revision 1= 96109)
+++ usr.bin/netstat/main.c=C2=A0=C2=A0=C2=A0 (working copy)
@@= -530,7 +530,6 @@
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0* used for the queries, which is slower.
= =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0*/
=C2=A0#endif
-=C2=A0=C2=A0=C2=A0 kr= ead(0, NULL, 0);
=C2=A0=C2=A0=C2=A0=C2=A0 if (iflag && !sflag) {=
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 intpr(interval, nl[N_IFNET]= .n_value, NULL);
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 exit(0);

Joshua A Piccari
/dv/
--0016e64601f4b902790470eb048d--