eclist matching question

Ondrej Zajicek santiago at crfreenet.org
Tue Jun 30 22:27:54 CEST 2020


On Tue, Jun 30, 2020 at 03:39:25PM +0300, Alexander Shikov wrote:
> On Mon, Jun 15, 2020 at 15:53:46 +0300, Alexander Shikov wrote:
> > Hello!
> > 
> > I have some strange behavior of list matching operator applied to eclist
> > in v.1.6.3.
> > 
> > Example filter function:
> > 
> > function test (int peer_as)
> > {
> >         if net = 109.68.40.0/21 &&
> >            peer_as = 28773 then {
> >                 print "DEBUG2: ", bgp_ext_community;
> >         }
> > 
> >         if (rt,65001,peer_as) ~ bgp_ext_community then {
> >                 print "DEBUG: Adding one prepend: ", bgp_path.first;
> >                 bgp_path.prepend(bgp_path.first);
> >         }
> > }
> > 
> > In log file I see bgp_ext_community attribute which includes
> > (rt,65001,28773) community:
> > 
> > Jun 15 15:37:52 <daemon.info> rs1 bird: DEBUG2: (eclist (rt, 65001, 13188) (rt, 65001, 28773) (ro, 31210, 25372))
> > 
> > But the later matching never succeeds, and I don't understand why.
> > Please advice. Thanks!
> 
> Hello!
> 
> The same behavior is in bird v2.0.
> Can anyone take a look? Thanks!

Hello

Works for me, at least in some similar setups.

Could you check if it works for expressions like:

bird> show route all where (rt,65001,28773) ~ bgp_ext_community


Or (function in config file):

function test2(int peer_as)
{
 if (rt,65001,peer_as) ~ bgp_ext_community then {
     return true;
  }
  return false;
}

bird> show route all where test2(28773)


-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at 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."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20200630/08f300bf/attachment.sig>


More information about the Bird-users mailing list