so what is the alternative pardion my ignorance but is it like a views in a DB

so we use a bit more memory so as the route (eg blackhole route is
copied to a table of blackhole routes ?

and an arp entry / host route is copied to an arp table that can be
dumped on demand ..

(with the necessary removal code in place...

so more memory used but then interactive commands cannot tax the box
too much when asking what are all the blackhole routes, reject routes
host routes / arp entries ?

Thanks
Tom Smyth

On Tue, 25 Jun 2024 at 10:00, Claudio Jeker <[email protected]> wrote:
>
> On Tue, Jun 25, 2024 at 08:35:18AM -0000, Stuart Henderson wrote:
> > On 2024-06-24, Tom Smyth <[email protected]> wrote:
> > > Folks,
> > > while  reviewing  nsh  I was wondering how to improve show route 
> > > commands...
> > > reviewing the man route man page,
> > >
> > > there doesnt seem to be a  straight forward way of displaying
> > > blackhole routes without using
> > >
> > > route show |grep B for blackhole
> > >
> > > route show |grep R for Reject
> > >
> > > is there something Im missing,
> > >
> > > would I be better off improving route(8) rather than stringing
> > > commands together for NSH ?
> >
> > It's not an efficient operation in the first place; kernel lookup is
> > done with the address/prefix as a key and the flags (B/R etc) are only
> > found once you've fetched a route (similar if you wanted to e.g. find
> > routes with a specific destination router).
> >
> > In order to find all routes with a certain flag you do need to dump
> > the whole route table and check it.
> >
> > It could be done slightly more efficiently with a check for the
> > relevant flag rather than going via a text processing tool like grep,
> > but I bet the actual overall time isn't going to be very different...
> >
>
> This is one of the things we need to fix. It is very similar to the
> problem arp -an has on bgp routers with a full table. This sysctl to grab
> the routing table is horrible and needs to die.
>
> --
> :wq Claudio
>


-- 
Kindest regards,
Tom Smyth.

Reply via email to