|
|||||||||||
|
user/3277: Netstat manpage
From: <aldo(at)nullcube.com>
Date: Fri May 30 2003 - 10:02:59 EDT
All
The netstat manpage description of the -I option (for specifying an interface) includes the following:
If the -f address_family option (with the -s option) or the -p protocol
option is present, show per-interface statistics on the given interface
for the specified address_family or protocol, re- spectively.
While trying to generate per-interface, per-protocol statistics (i.e. netstat -I fxp0 -p icmp), I noticed that I was getting the same set of statistics for all interfaces. A quick look at the netstat source code confirmed that the -p option simply runs the appropriate protocol stats dumper (e.g. icmp_stats in inet.c), without any regard for the interface selection. Further investigation shows that generating per-interface protocol statistics of this kind may in fact be impossible at the moment - the kernel only keeps a single protocol stats struct (e.g. icmpstat) for each protocol. >How-To-Repeat:
netstat -I iface -p proto Notice that the protocol states are the same, regardless of the interface specified. >Fix:
The following patch modifies the description of the -I and -i options, and removes the misleading line from the synopsis.
? diff
RCS file: /cvs/src/usr.bin/netstat/netstat.1,v retrieving revision 1.28 diff -r1.28 netstat.1 65,68d64 < .Op Fl p Ar protocol < .Op Fl i < .Op Fl I Ar Interface < .Nm netstat 151,154c147,148 < option) or the < .Fl p Ar protocol < option is present, show per-interface statistics on the given interface < for the specified ---Received on Fri May 30 10:20:28 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:57 EDT |
||||||||||
|
|||||||||||