redesigned version of bgp in bird2 changes the rs client behaviour

Alexander Zubkov green at qrator.net
Fri Nov 2 17:21:16 CET 2018


I have also looked further for routes not imported from bgp. In this case
bird1 also adds prepend, because "rs client" condition is not checked here
in bgp_create_attr:
https://gitlab.labs.nic.cz/labs/bird/blob/fff79b1c1e0577f487b4fb67f79a74b054d734b6/proto/bgp/attrs.c#L1029

  if (p->is_internal)
    bgp_set_attr_wa(ea->attrs+1, pool, BA_AS_PATH, 0);

On Fri, Nov 2, 2018 at 12:43 PM, Alexander Zubkov <green at qrator.net> wrote:

> Hello,
>
> I found out that bird version 2 prepends its ASN when exporting to eBGP
> peer and "rs client" option enabled. I made some investigation and found
> out that bgp code was hardly redesigned and the logic of "rs client" was
> changed.
> Here is v1.
> https://gitlab.labs.nic.cz/labs/bird/blob/fff79b1c1e0577f487b4fb67f79a74
> b054d734b6/proto/bgp/attrs.c#L1100
>
>   if (!p->is_internal && !p->rs_client)
>     {
>       bgp_path_prepend(e, attrs, pool, p->local_as);
>
> And this is in v2 now.
> https://gitlab.labs.nic.cz/labs/bird/blob/e19d08055a4614f03e51ee72617be1
> 0946ce7919/proto/bgp/attrs.c#L1451
>
>   if (p->is_internal ||
>       (p->rs_client && src && src->rs_client))
>   {
>
> If I get it right, it does not prepend its ASN only in the case when route
> was received from BGP session too and that session is marked "rs client".
> So only prefixes from one "rs client" to another is not prepended.
>
> It looks like it is impossible now to skip prepend for eBGP for some local
> routes, for example. I wish it was made an old style way - when "rs client"
> skips prepend unconditionally.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20181102/3b5c66d4/attachment.html>


More information about the Bird-users mailing list