]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: Skip RD match if ACCEPT_OWN is not enabled
authorRyoga Saito <ryoga.saito@linecorp.com>
Thu, 19 Jan 2023 11:51:44 +0000 (20:51 +0900)
committerRyoga Saito <ryoga.saito@linecorp.com>
Fri, 20 Jan 2023 06:28:39 +0000 (15:28 +0900)
commitdd2d28ea997ae3acc702d059efece5941f8db6aa
treee3d82892f94d2ed3e840bb3f1b58dd426326d6d9
parent03cc2022d2c75be7e01d5eab2ac422d599765673
bgpd: Skip RD match if ACCEPT_OWN is not enabled

RFC7611 introduces new extended community ACCEPT_OWN and is already
implemented for FRR in the previous PR. However, this PR broke
compatibility about importing VPN routes.

Let's consider the following situation. There are 2 routers and these
routers connects with iBGP session. These routers have two VRF, vrf10
and vrf20, and RD 0:10, 0:20 is configured as the route distinguisher
of vrf10 and vrf20 respectively.

    +- R1 --------+    +- R2 --------+
    | +---------+ |    | +---------+ |
    | |  VRF10  | |    | |  VRF10  | |
    | | RD 0:10 +--------+ RD 0:10 | |
    | +---------+ |    | +---------+ |
    | +---------+ |    | +---------+ |
    | |  VRF20  +--------+  VRF20  | |
    | | RD 0:20 | |    | | RD 0:20 | |
    | +---------+ |    | +---------+ |
    +-------------+    +-------------+

In this situation, the VPN routes from R1's VRF10 should be imported to
R2's VRF10 and the VPN routes from R2's VRF10 should be imported to R2's
VRF20. However, the current implementation of ACCEPT_OWN will always
reject routes if the RD of VPN routes are matched with the RD of VRF.

Similar issues will happen in local VRF2VRF route leaks. In such cases,
the route reaked from VRF10 should be imported to VRF20. However, the
current implementation of ACCEPT_OWN will not permit them.

    +- R1 ---------------------+
    |      +------------+      |
    | +----v----+  +----v----+ |
    | |  VRF10  |  |  VRF20  | |
    | | RD 0:10 |  | RD 0:10 | |
    | +---------+  +---------+ |
    +--------------------------+

So, this commit add additional condition in RD match. If the route
doesn't have ACCEPT_OWN extended community, source VRF check will be
skipped.

[RFC7611]: https://datatracker.ietf.org/doc/html/rfc7611

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
bgpd/bgp_mplsvpn.c