This reminds me of a meme...
https://img-comment-fun.9cache.com/media/ay9BKnV/aWlGMBgm_700w_0.jpg

Em qua., 26 de jul. de 2023 às 20:54, Ondrej Zajicek <santiago@crfreenet.org> escreveu:
On Thu, Jul 20, 2023 at 08:25:24PM +0800, Brandon Zhi wrote:
> Hi all,
>
> I was doing research about selecting the best route on multiple nodes based
> on bgp_med attributes.
>
>
> My idea is to add bgp_med value between each node based on ping, and then
> bird will select the route which has the lowest bgp_med value (which is the
> total ping delay)
>
> But some routes will be filled, which i don't want it.
>
> I found that the code " bgp_med = bgp_med + bgp_med_ping + bgp_med_ping;"
> will cause some routes to be filtered.
>
> Can someone tell me why? I only want to modify bgp_med and don't want my
> routes to be filtered.

Hi

Perhaps there are some error in logs about filter failures? I guess that
when bgp_med is not defined, then expression 'bgp_med + X' fails.

You could try something like:

  if (defined(bgp_med))
    bgp_med = bgp_med + X;
  else
    bgp_med = X;


And perhaps even better than use bgp_med for this is to use bgp_aigp
attribute and associated BGP options (aigp, cost).

--
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."


--
Douglas Fernando Fischer
Engº de Controle e Automação