From bernd@heitec.net  Thu May 19 16:45:40 2005
Return-Path: <bernd@heitec.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8805316A4E1
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 19 May 2005 16:45:40 +0000 (GMT)
Received: from christel.heitec.net (christel.heitec.net [62.206.253.11])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AE0AC43D60
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 19 May 2005 16:45:39 +0000 (GMT)
	(envelope-from bernd@heitec.net)
Received: from tostan.admin.er.heitec.net (paladin.heitec.net [62.206.253.14])
	by christel.heitec.net (Postfix) with ESMTP id ACC20A8941
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 19 May 2005 15:09:58 +0200 (CEST)
Received: (from bernd@localhost)
	by tostan.admin.er.heitec.net (8.13.3/8.13.1/Submit) id j4JD9w4t066160;
	Thu, 19 May 2005 15:09:58 +0200 (CEST)
	(envelope-from bernd)
Message-Id: <200505191309.j4JD9w4t066160@tostan.admin.er.heitec.net>
Date: Thu, 19 May 2005 15:09:58 +0200 (CEST)
From: Bernd Luevelsmeyer <bernd@heitec.net>
Reply-To: Bernd Luevelsmeyer <bdluevel@heitec.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Tool 'netstat' needs 'device mem' in the kernel
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         81273
>Category:       kern
>Synopsis:       [request] remove dependency of tool 'netstat' on 'device mem' in the kernel
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          suspended
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 19 16:50:03 GMT 2005
>Closed-Date:    
>Last-Modified:  Wed Aug 12 06:00:16 UTC 2009
>Originator:     Bernd Luevelsmeyer
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD 5.4-STABLE i386

>Description:
With a kernel that doesn't have "device mem", the tool "netstat"
doesn't work. As far as I can tell, "device mem" isn't necessary for
anything else in the basic system to work. I request that "netstat" be
not dependent on "device mem", which I would like to get rid of in
production machines.

>How-To-Repeat:

With a kernel that doesn't have "device mem":

$ netstat
netstat: kvm not available
netstat: kvm not available

>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: kris 
State-Changed-When: Thu May 19 22:41:34 GMT 2005 
State-Changed-Why:  
Software wish-list; suspend until someone provides patches to implement. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=81273 

From: Joshua Piccari <yosh@joshuapiccari.com>
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.<br>
 <br>Index: usr.bin/netstat/main.c<br>=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<br>--- usr.bin/netstat/main.c=C2=A0=C2=A0=C2=A0 (revision 1=
 96109)<br>+++ usr.bin/netstat/main.c=C2=A0=C2=A0=C2=A0 (working copy)<br>@@=
  -530,7 +530,6 @@<br>
 =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0* used for the queries, which is slower.<br>=
 =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0*/<br>=C2=A0#endif<br>-=C2=A0=C2=A0=C2=A0 kr=
 ead(0, NULL, 0);<br>=C2=A0=C2=A0=C2=A0=C2=A0 if (iflag &amp;&amp; !sflag) {=
 <br>=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 intpr(interval, nl[N_IFNET]=
 .n_value, NULL);<br>=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 exit(0);<br=
 ><br><br clear=3D"all">
 Joshua A Piccari<br>/dv/<br>
 
 --0016e64601f4b902790470eb048d--
>Unformatted:
