On Wed, Dec 21, 2022 at 10:21:16AM -0700, Theo de Raadt wrote:
> Claudio Jeker <cje...@diehard.n-r-g.com> wrote:
> 
> > In the old world only netstat could show the routing table. I think this
> > is still the case in FreeBSD for example. We added route show at some
> > point but the documentation was not shared between the manpages.
> > I agree that it is annoying to open up the netstat man page to find the
> > flags shown by route show. For this we added:
> > 
> >              Print out the routing table, in a fashion similar to
> >                  "netstat -r".  The output is documented in more detail
> >                  towards the end of the netstat(1) manual.
> > 
> > To the route manpage when describing route show. Not sure if that is
> > enough or if we should duplicate tables (whith the usual sync problem).
> 
> This is all true.
> 
> So netstat in those days was more of a "kvm reader" program, and as such
> racy.  Nowadays both route & netstat programs's subcommands are a mix of
> sysctl readers and route socket askers/listeners, and thus they have
> better atomicity or at least other types of truth.
> 
> The sub-command extensions in route are better designed, mostly because
> they are newer and were built in an era where kernels maintained more than
> a handful of routes.  I think we want to lean people towards using route,
> instead of netstat.
> 
> So I think route.8 is where we should try to have complete documentation,
> and once that is done we should change Xr's and other documentation to 
> point at route.8 instead of netstat.8

The show code of netstat and route should be in sync. I did that long time
ago. The kvm bits are only used in netstat and may be broken again. Did
not try lately.

Still I think 'route show' is more obvious and has a few extra arguments
over netstat -rn.

-- 
:wq Claudio

Reply via email to