mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 10:54:47 +00:00
Merge pull request #6375 from adharkar/frr-master-l3vni_label
bgpd: EVPN RT-2 advertised with 2 labels for prefix-routes-only config
This commit is contained in:
commit
eeec40ba69
@ -5824,9 +5824,31 @@ int bgp_evpn_local_l3vni_add(vni_t l3vni, vrf_id_t vrf_id,
|
|||||||
is_anycast_mac ? "Enable" : "Disable");
|
is_anycast_mac ? "Enable" : "Disable");
|
||||||
}
|
}
|
||||||
/* set the right filter - are we using l3vni only for prefix routes? */
|
/* set the right filter - are we using l3vni only for prefix routes? */
|
||||||
if (filter)
|
if (filter) {
|
||||||
SET_FLAG(bgp_vrf->vrf_flags, BGP_VRF_L3VNI_PREFIX_ROUTES_ONLY);
|
SET_FLAG(bgp_vrf->vrf_flags, BGP_VRF_L3VNI_PREFIX_ROUTES_ONLY);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* VNI_FLAG_USE_TWO_LABELS flag for linked L2VNIs should not be
|
||||||
|
* set before linking vrf to L3VNI. Thus, no need to clear
|
||||||
|
* that explicitly.
|
||||||
|
*/
|
||||||
|
} else {
|
||||||
|
UNSET_FLAG(bgp_vrf->vrf_flags,
|
||||||
|
BGP_VRF_L3VNI_PREFIX_ROUTES_ONLY);
|
||||||
|
|
||||||
|
for (ALL_LIST_ELEMENTS_RO(bgp_vrf->l2vnis, node, vpn)) {
|
||||||
|
if (!CHECK_FLAG(vpn->flags, VNI_FLAG_USE_TWO_LABELS)) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we are flapping VNI_FLAG_USE_TWO_LABELS
|
||||||
|
* flag, update all MACIP routes in this VNI
|
||||||
|
*/
|
||||||
|
SET_FLAG(vpn->flags, VNI_FLAG_USE_TWO_LABELS);
|
||||||
|
update_all_type2_routes(bgp_evpn, vpn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Map auto derive or configured RTs */
|
/* Map auto derive or configured RTs */
|
||||||
if (!CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_IMPORT_RT_CFGD))
|
if (!CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_IMPORT_RT_CFGD))
|
||||||
evpn_auto_rt_import_add_for_vrf(bgp_vrf);
|
evpn_auto_rt_import_add_for_vrf(bgp_vrf);
|
||||||
|
@ -270,8 +270,12 @@ static inline void bgpevpn_link_to_l3vni(struct bgpevpn *vpn)
|
|||||||
vpn->bgp_vrf = bgp_lock(bgp_vrf);
|
vpn->bgp_vrf = bgp_lock(bgp_vrf);
|
||||||
listnode_add_sort(bgp_vrf->l2vnis, vpn);
|
listnode_add_sort(bgp_vrf->l2vnis, vpn);
|
||||||
|
|
||||||
/* check if we are advertising two labels for this vpn */
|
/*
|
||||||
if (!CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_L3VNI_PREFIX_ROUTES_ONLY))
|
* If L3VNI is configured,
|
||||||
|
* check if we are advertising two labels for this vpn
|
||||||
|
*/
|
||||||
|
if (bgp_vrf->l3vni &&
|
||||||
|
!CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_L3VNI_PREFIX_ROUTES_ONLY))
|
||||||
SET_FLAG(vpn->flags, VNI_FLAG_USE_TWO_LABELS);
|
SET_FLAG(vpn->flags, VNI_FLAG_USE_TWO_LABELS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user