On Mon, Feb 13, 2023 at 04:20:00PM +0100, Theo Buehler wrote:
> On Mon, Feb 13, 2023 at 02:33:05PM +0100, Claudio Jeker wrote:
> > Instead of passing the rib and new and old best prefix just pass the
> > rib_entry to rde_generate_updates(). This simplifies a few things down
> > that rabbit hole. This is also a step towards decoupling prefix_evaluate()
> > and the Loc-RIB from rde_generate_updates() and the Adj-RIB-Out
> > processing.
> > 
> > Since the rib_entry is passed there is now always a valid prefix pointer
> > in re->prefix and a lot of the if (new) else if (old) cascades can be
> > simplified a lot.
> 
> Very nice.
> 
> > There is a trivial fix requried in the regress test, that I have ready but
> > did not share here.
> 
> thanks
> 
> ok, just a small comment below
> 
> > -- 
> > :wq Claudio
> > 
> > Index: rde.c
> > ===================================================================
> > RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
> > retrieving revision 1.592
> > diff -u -p -r1.592 rde.c
> > --- rde.c   9 Feb 2023 13:43:23 -0000       1.592
> > +++ rde.c   13 Feb 2023 11:14:18 -0000
> > @@ -3888,14 +3888,13 @@ rde_softreconfig_in(struct rib_entry *re
> >  static void
> >  rde_softreconfig_out(struct rib_entry *re, void *arg)
> >  {
> > -   struct rib      *rib = arg;
> >     struct prefix   *p;
> >  
> >     if ((p = prefix_best(re)) == NULL)
> >             /* no valid path for prefix */
> >             return;
> >  
> > -   rde_generate_updates(rib, p, NULL, NULL, NULL, EVAL_RECONF);
> > +   rde_generate_updates(re, NULL, NULL, EVAL_RECONF);
> 
> Unless you want to use p in a follow-up diff, I suggest you garbage
> collect it.

Good point. I removed it. 

-- 
:wq Claudio

Reply via email to