Bug 81273 - [request] remove dependency of tool 'netstat' on 'device mem' in the kernel
Summary: [request] remove dependency of tool 'netstat' on 'device mem' in the kernel
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 5.4-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-19 17:50 UTC by Bernd Luevelsmeyer
Modified: 2018-05-20 23:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Luevelsmeyer 2005-05-19 17:50:03 UTC
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
Comment 1 Kris Kennaway freebsd_committer freebsd_triage 2005-05-19 23:41:34 UTC
State Changed
From-To: open->suspended

Software wish-list; suspend until someone provides patches to implement.
Comment 2 yosh 2009-08-12 06:23:25 UTC
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/
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:50:25 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"