Bug 29276

Summary: netstat -i gives no respect to -f, -p despite of man describe it as giving...
Product: Base System Reporter: Igor M Podlesny <poige>
Component: miscAssignee: ru <ru>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-STABLE   
Hardware: Any   
OS: Any   

Description Igor M Podlesny 2001-07-28 13:30:00 UTC
man 8 netstat says (in -i paragraph) that
"...if the -f address_family option (with the -s option) or the -p
protocol option is present, show per-interface statistics on all
interfaces for the specfied address_family or protocol, respectively..."
in fact it doesn't.

Fix: 

Re-writing either netstat or it's man page. May be even them both,
cause they both are really out of sync with reality.
(for e.g., netstat -abadopt gives the "usage" and "usage" says
nothing bout -i)
How-To-Repeat: You may use diff <(netstat -n -f inet -i) <(netstat -n -i)
and it won't give and difference hence...
Comment 1 Peter Pentchev freebsd_committer freebsd_triage 2001-07-29 15:05:50 UTC
Responsible Changed
From-To: freebsd-bugs->ru

Wasn't Ruslan working on something similar in -current?
Comment 2 ru freebsd_committer freebsd_triage 2001-08-10 12:00:41 UTC
On Sat, Jul 28, 2001 at 05:20:17AM -0700, Igor M Podlesny wrote:
> 
> man 8 netstat says (in -i paragraph) that
> "...if the -f address_family option (with the -s option) or the -p
> protocol option is present, show per-interface statistics on all
> interfaces for the specfied address_family or protocol, respectively..."
> in fact it doesn't.

In the paragraph you quoted, there is the mention of the -s option.
The -f and -p are only supported with -i if -s is also specified.
Manpage has not been clear about that, and has since been fixed.

Basically, there are four displays (except others):

1.  Protocol control blocks (PCB) display.
2.  Protocol statistics display. (-s)
3.  Interface statistics display. (-i)
4.  Per-interface protocol statistics display. (-i -s)

All of the above except 3) can be limited to a particular
protocol family (-f) or a single protocol (-p).

Some examples would be:

1.  netstat -f inet    -- show PCBs of all INET protocols
2.  netstat -p udp     -- show PCB of UDP protocol only (NEW!)
3.  netstat -s         -- show protocol statistics for all families
4.  netstat -s -f inet -- show INET protocols statistics
5.  netstat -s -p icmp -- show ICMP protocol statistics


Cheers,
-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age
Comment 3 ru freebsd_committer freebsd_triage 2001-08-10 12:03:06 UTC
State Changed
From-To: open->closed

Asked and answered.