Page MenuHomeFreeBSD

netstat(1): Add nexthop statistics support with -os flag
ClosedPublic

Authored by pouria on Jul 29 2026, 6:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 6, 6:03 AM
Unknown Object (File)
Sun, Sep 6, 1:58 AM
Unknown Object (File)
Sat, Sep 5, 9:24 PM
Unknown Object (File)
Sat, Sep 5, 7:20 PM
Unknown Object (File)
Sat, Sep 5, 6:13 PM
Unknown Object (File)
Sat, Sep 5, 3:34 AM
Unknown Object (File)
Fri, Sep 4, 3:37 AM
Unknown Object (File)
Thu, Sep 3, 9:42 PM
Subscribers

Details

Summary

Add support nexthop statistics and update its manual.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kfv requested changes to this revision.Thu, Aug 20, 7:05 PM
kfv added inline comments.
usr.bin/netstat/main.c
919–920

Please update usage(). Also, I would highly appreciate it if you could do a separate commit to document the other missing -o/-O -4 | -6 (whether here or in another DR).

usr.bin/netstat/netstat.1
111–113

Just like -rs, -os uses the same fetch_stats() + nlist path, so -M, -N, and -j would similarly work and apply to -os as well.

121

Added by mistake? To my understanding, Oflag never looks at sflag, but please correct me if I'm missing something, or just drop it.

460–462

Same as my note on SYNOPSIS.

usr.bin/netstat/netstat.h
40–61

Not related to this patch, but just a friendly request/reminder while we're both here. While studying the codebase, I noticed that none of iflag, gflag, mflag, or rflag are used anywhere outside main.c. For the same reason we're not having Oflag/oflag as externs, I presume we should drop these externs as well and declare them as matching static bools in main.c. We could also make Oflag/oflag static there too.

Anyway, this is unrelated to the patch, just wanted to mention it while I was looking at the code.

This revision now requires changes to proceed.Thu, Aug 20, 7:05 PM
pouria marked 4 inline comments as done.

Address @kfv comments. Thank you!

netstat.1: Remove -N/-M options in -o/-O, but keep the -j/--libxo for those options.

Looks good to me. Thanks!

This revision is now accepted and ready to land.Thu, Aug 20, 9:32 PM