Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 May 2018 14:32:44 -0700
From:      Dieter BSD <dieterbsd@gmail.com>
To:        freebsd-net@freebsd.org
Cc:        freebsd-hackers@freebsd.org
Subject:   netstat(1) -s -f is broken
Message-ID:  <CAA3ZYrAxkzX14uEoZUboVgWMDHNjJGZ_x=wsJ=de5iFpQqoSFA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
FreeBSD 10.3-RELEASE

The fine man page promises:
     netstat -i | -I interface -s [-46] [-f protocol_family | -p protocol]
             [-M core] [-N system]
             Display per-interface statistics for each network protocol, for a
             particular protocol_family, or for a single protocol.

But in reality,
netstat -I interface -s -f family
only works if family is inet6.

interface=lo0
for fam in inet inet6 pfkey atalk netgraph ipx unix link
do
        echo -n interface = $interface  fam = $fam
        netstat -I $interface -s -f $fam | wc
done

interface = lo0 fam = inet       0       0       0
interface = lo0 fam = inet6      56     258    1728
interface = lo0 fam = pfkey       0       0       0
interface = lo0 fam = atalk       0       0       0
interface = lo0 fam = netgraph       0       0       0
interface = lo0 fam = ipx       0       0       0
interface = lo0 fam = unix       0       0       0
interface = lo0 fam = link       0       0       0

I had this in a loop with all the interfaces, the results are
the same for all interfaces.

Doesn't work with -p either.
netstat -I lo0 -s -p udp
:udp: no per-interface stats routine

It would be very useful if this actually worked.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAA3ZYrAxkzX14uEoZUboVgWMDHNjJGZ_x=wsJ=de5iFpQqoSFA>