mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-18 16:34:28 +00:00
Merge pull request #4847 from vivek-cumulus/evpn-route-import-fix
bgpd: Ensure correct checks for EVPN route import
This commit is contained in:
commit
614338c6ac
@ -4459,7 +4459,8 @@ void bgp_evpn_configure_import_rt_for_vrf(struct bgp *bgp_vrf,
|
||||
struct ecommunity *ecomadd)
|
||||
{
|
||||
/* uninstall routes from vrf */
|
||||
uninstall_routes_for_vrf(bgp_vrf);
|
||||
if (is_l3vni_live(bgp_vrf))
|
||||
uninstall_routes_for_vrf(bgp_vrf);
|
||||
|
||||
/* Cleanup the RT to VRF mapping */
|
||||
bgp_evpn_unmap_vrf_from_its_rts(bgp_vrf);
|
||||
@ -4471,11 +4472,11 @@ void bgp_evpn_configure_import_rt_for_vrf(struct bgp *bgp_vrf,
|
||||
listnode_add_sort(bgp_vrf->vrf_import_rtl, ecomadd);
|
||||
SET_FLAG(bgp_vrf->vrf_flags, BGP_VRF_IMPORT_RT_CFGD);
|
||||
|
||||
/* map VRF to its RTs */
|
||||
bgp_evpn_map_vrf_to_its_rts(bgp_vrf);
|
||||
|
||||
/* install routes matching the new VRF */
|
||||
install_routes_for_vrf(bgp_vrf);
|
||||
/* map VRF to its RTs and install routes matching the new RTs */
|
||||
if (is_l3vni_live(bgp_vrf)) {
|
||||
bgp_evpn_map_vrf_to_its_rts(bgp_vrf);
|
||||
install_routes_for_vrf(bgp_vrf);
|
||||
}
|
||||
}
|
||||
|
||||
void bgp_evpn_unconfigure_import_rt_for_vrf(struct bgp *bgp_vrf,
|
||||
@ -4485,7 +4486,8 @@ void bgp_evpn_unconfigure_import_rt_for_vrf(struct bgp *bgp_vrf,
|
||||
struct ecommunity *ecom = NULL;
|
||||
|
||||
/* uninstall routes from vrf */
|
||||
uninstall_routes_for_vrf(bgp_vrf);
|
||||
if (is_l3vni_live(bgp_vrf))
|
||||
uninstall_routes_for_vrf(bgp_vrf);
|
||||
|
||||
/* Cleanup the RT to VRF mapping */
|
||||
bgp_evpn_unmap_vrf_from_its_rts(bgp_vrf);
|
||||
@ -4509,11 +4511,11 @@ void bgp_evpn_unconfigure_import_rt_for_vrf(struct bgp *bgp_vrf,
|
||||
evpn_auto_rt_import_add_for_vrf(bgp_vrf);
|
||||
}
|
||||
|
||||
/* map VRFs to its RTs */
|
||||
bgp_evpn_map_vrf_to_its_rts(bgp_vrf);
|
||||
|
||||
/* install routes matching this new RT */
|
||||
install_routes_for_vrf(bgp_vrf);
|
||||
/* map VRFs to its RTs and install routes matching this new RT */
|
||||
if (is_l3vni_live(bgp_vrf)) {
|
||||
bgp_evpn_map_vrf_to_its_rts(bgp_vrf);
|
||||
install_routes_for_vrf(bgp_vrf);
|
||||
}
|
||||
}
|
||||
|
||||
void bgp_evpn_configure_export_rt_for_vrf(struct bgp *bgp_vrf,
|
||||
|
@ -275,6 +275,11 @@ static inline int is_vni_live(struct bgpevpn *vpn)
|
||||
return (CHECK_FLAG(vpn->flags, VNI_FLAG_LIVE));
|
||||
}
|
||||
|
||||
static inline int is_l3vni_live(struct bgp *bgp_vrf)
|
||||
{
|
||||
return (bgp_vrf->l3vni && bgp_vrf->l3vni_svi_ifindex);
|
||||
}
|
||||
|
||||
static inline int is_rd_configured(struct bgpevpn *vpn)
|
||||
{
|
||||
return (CHECK_FLAG(vpn->flags, VNI_FLAG_RD_CFGD));
|
||||
|
Loading…
Reference in New Issue
Block a user