Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

user/3277: Netstat manpage

From: <aldo(at)nullcube.com>
Date: Fri May 30 2003 - 10:02:59 EDT


>Number: 3277
>Category: user
>Synopsis: Netstat manpage does not reflect reality
>Confidential: yes
Aldo Cortesi
aldo@nullcube.com
http://www.nullcube.com
>Environment:

    All
>Description:
    

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.

Do you need help?X

>Fix:

The following patch modifies the description of the -I and -i options, and removes the misleading line from the synopsis.

? diff
? netstat.cat1
Index: netstat.1



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
---

> option) is present, show per-interface
> statistics on the given interface for the specified
156,158c150 < or < .Ar protocol , < respectively. ---
> .
175,177c167 < option) or the < .Fl p Ar protocol < option is present, show per-interface statistics on all interfaces ---
> option) is present, show per-interface statistics on all interfaces
180,182c170 < or < .Ar protocol , < respectively. ---
> .

>Release-Note:
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


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library