netstat(1) -s -f is broken
Sean Bruno
sbruno at freebsd.org
Tue May 29 12:50:56 UTC 2018
On 05/03/18 15:32, Dieter BSD wrote:
> 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.
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>
Wow, this sure looks like a bug.
sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 618 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20180529/e53d5f26/attachment.sig>
More information about the freebsd-net
mailing list