diff options
author | Chirag Shah <chirag@cumulusnetworks.com> | 2018-12-07 03:03:58 +0100 |
---|---|---|
committer | Chirag Shah <chirag@cumulusnetworks.com> | 2018-12-08 18:02:54 +0100 |
commit | 530e8a6e7e94740ef0a6ce8d3acf1e925ed328cf (patch) | |
tree | 157ffc3bd700c85628cf9bf68e8d501d853f088d /bgpd/bgp_evpn.c | |
parent | Merge pull request #3444 from donaldsharp/adj_stuff (diff) | |
download | frr-530e8a6e7e94740ef0a6ce8d3acf1e925ed328cf.tar.xz frr-530e8a6e7e94740ef0a6ce8d3acf1e925ed328cf.zip |
bgpd: l3vni add-del handle non-defualt rt
During L3VNI add delete, configured non-default
route-target is not replayed correctly.
Non-default route-target should only be deleted
during unconfiguring under bgp vrf instance,
during delete of l3vni only unmap from the VRF.
during addition of l3vni map back to the VRF
Ticket:CM-21482
Testing Done:
Bring up evpn configuration with L3vni up with
non-default route-target.
Perform delete/add of L3vni and validated non-default
route-target is mapped back to vrf.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_evpn.c')
-rw-r--r-- | bgpd/bgp_evpn.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index ac5880938..93c0ac741 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -5447,11 +5447,16 @@ int bgp_evpn_local_l3vni_add(vni_t l3vni, vrf_id_t vrf_id, struct ethaddr *rmac, if (filter) SET_FLAG(bgp_vrf->vrf_flags, BGP_VRF_L3VNI_PREFIX_ROUTES_ONLY); - /* auto derive RD/RT */ + /* 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); + else + bgp_evpn_map_vrf_to_its_rts(bgp_vrf); + if (!CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_EXPORT_RT_CFGD)) evpn_auto_rt_export_add_for_vrf(bgp_vrf); + + /* auto derive RD */ bgp_evpn_derive_auto_rd_for_vrf(bgp_vrf); /* link all corresponding l2vnis */ @@ -5519,12 +5524,16 @@ int bgp_evpn_local_l3vni_del(vni_t l3vni, vrf_id_t vrf_id) /* remove the Rmac from the BGP vrf */ memset(&bgp_vrf->rmac, 0, sizeof(struct ethaddr)); - /* delete RD/RT */ + /* remove default import RT or Unmap non-default import RT */ if (!list_isempty(bgp_vrf->vrf_import_rtl)) { bgp_evpn_unmap_vrf_from_its_rts(bgp_vrf); - list_delete_all_node(bgp_vrf->vrf_import_rtl); + if (!CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_IMPORT_RT_CFGD)) + list_delete_all_node(bgp_vrf->vrf_import_rtl); } - if (!list_isempty(bgp_vrf->vrf_export_rtl)) { + + /* remove default export RT */ + if (!list_isempty(bgp_vrf->vrf_export_rtl) && + !CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_EXPORT_RT_CFGD)) { list_delete_all_node(bgp_vrf->vrf_export_rtl); } |