]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: detect change of RT for L3VPN routes
authorPat Ruddy <pat@voltanet.io>
Thu, 2 Jul 2020 16:33:37 +0000 (17:33 +0100)
committerPat Ruddy <pat@voltanet.io>
Thu, 2 Jul 2020 20:22:48 +0000 (21:22 +0100)
If the RT changes on a L3VPN route then any leak of this route into
a VRF should be withdrawn.
Extend existing EVPN check for RT change to cover L3VPN routes.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
bgpd/bgp_route.c

index 17bf9afe7d4df31cbb7be4683e6fe6ac2b8fedf6..ad437c6ba48046d40144540d5cc6a5155ac3427e 100644 (file)
@@ -3667,7 +3667,8 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
                 * subsequently processed for import with the new extended
                 * community.
                 */
-               if (safi == SAFI_EVPN && !same_attr) {
+               if (((safi == SAFI_EVPN) || (safi == SAFI_MPLS_VPN))
+                   && !same_attr) {
                        if ((pi->attr->flag
                             & ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES))
                            && (attr_new->flag
@@ -3684,8 +3685,12 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
                                                                pi->attr->ecommunity),
                                                        ecommunity_str(
                                                                attr_new->ecommunity));
-                                       bgp_evpn_unimport_route(bgp, afi, safi,
-                                                               p, pi);
+                                       if (safi == SAFI_EVPN)
+                                               bgp_evpn_unimport_route(
+                                                       bgp, afi, safi, p, pi);
+                                       else /* SAFI_MPLS_VPN */
+                                               vpn_leak_to_vrf_withdraw(bgp,
+                                                                        pi);
                                }
                        }
                }