Skip to content

Commit

Permalink
Merge pull request #6375 from adharkar/frr-master-l3vni_label
Browse files Browse the repository at this point in the history
bgpd: EVPN RT-2 advertised with 2 labels for prefix-routes-only config
  • Loading branch information
riw777 committed May 26, 2020
2 parents 06fba5c + 10f7051 commit eeec40b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
24 changes: 23 additions & 1 deletion bgpd/bgp_evpn.c
Expand Up @@ -5824,9 +5824,31 @@ int bgp_evpn_local_l3vni_add(vni_t l3vni, vrf_id_t vrf_id,
is_anycast_mac ? "Enable" : "Disable");
}
/* 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);

/*
* 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 */
if (!CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_IMPORT_RT_CFGD))
evpn_auto_rt_import_add_for_vrf(bgp_vrf);
Expand Down
8 changes: 6 additions & 2 deletions bgpd/bgp_evpn_private.h
Expand Up @@ -270,8 +270,12 @@ static inline void bgpevpn_link_to_l3vni(struct bgpevpn *vpn)
vpn->bgp_vrf = bgp_lock(bgp_vrf);
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);
}

Expand Down

0 comments on commit eeec40b

Please sign in to comment.