On Fri, Jun 03, 2022 at 03:33:57PM +0200, Claudio Jeker wrote:
> fib_priority was slapped into the code by passing it around all the time.
> It is much smarter to use a global value in kr_state for the fib_prio and
> then tag F_BGP_INSERTED routes with RTP_MINE (0xff) which is an impossible
> RTP value. With that changing the prio requires "only" a fib decouple,
> change global state, fib couple.
>
> It will also allow for better support of blackhole routes and makes the
> code a fair bit simpler.
Yes, this is a nicer approach. It reads fine.
ok with one tiny nit
> Index: kroute.c
> ===================================================================
[...]
> @@ -950,54 +950,30 @@ kr_fib_decouple(u_int rtableid, uint8_t
>
> RB_FOREACH(kr, kroute_tree, &kt->krt)
> if ((kr->r.flags & F_BGPD_INSERTED))
> - send_rtmsg(kr_state.fd, RTM_DELETE, kt, &kr->r,
> - fib_prio);
> + send_rtmsg(kr_state.fd, RTM_DELETE, kt, &kr->r);
> RB_FOREACH(kr6, kroute6_tree, &kt->krt6)
> if ((kr6->r.flags & F_BGPD_INSERTED))
> - send_rt6msg(kr_state.fd, RTM_DELETE, kt, &kr6->r,
> - fib_prio);
> + send_rt6msg(kr_state.fd, RTM_DELETE, kt, &kr6->r);
>
> kt->fib_sync = 0;
>
> log_info("kernel routing table %u (%s) decoupled", kt->rtableid,
> - kt->descr);
> -}
> + kt->descr);
> + }
Please undo this wrong indentation.