diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index d81e7c5e830..0084426540f 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -550,6 +550,8 @@ main(int argc, char *argv[]) if (gflag) { + if (fib != -1 && setfib(fib) < 0) + xo_errx(EX_DATAERR, "setfib: %s", strerror(errno)); xo_open_container("statistics"); xo_set_version(NETSTAT_XO_VERSION); if (sflag) { diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index a726c703752..5c7f2336c06 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 3, 2026 +.Dd April 7, 2026 .Dt NETSTAT 1 .Os .Sh NAME @@ -94,6 +94,7 @@ .Op Fl j Ar jail .Op Fl -libxo .Op Fl 46W +.Op Fl F Ar fibnum .Op Fl f Ar address_family .It Nm Fl gs .Op Fl j Ar jail @@ -738,6 +739,7 @@ See .Nm .Fl g .Op Fl 46W +.Op Fl F Ar fibnum .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system @@ -764,6 +766,15 @@ See .Sx GENERAL OPTIONS . .It Fl W Avoid truncating addresses even if this causes some fields to overflow. +.It Fl F +Display the routing table with the number +.Ar fibnum . +If the specified +.Ar fibnum +is -1 or +.Fl F +is not specified, +the default routing table is displayed. .It Fl f Ar protocol_family Filter by .Ar protocol_family .