diff options
author | Ameya Dharkar <adharkar@vmware.com> | 2021-04-06 00:54:48 +0200 |
---|---|---|
committer | Ameya Dharkar <adharkar@vmware.com> | 2021-04-28 01:35:24 +0200 |
commit | d60f63f0872741921d192fa0e9b85d3c11982319 (patch) | |
tree | 105877e1abd2180a83d4f2a91965c0d0973bddb2 /bgpd/bgp_evpn.c | |
parent | Merge pull request #8548 from donaldsharp/bgp_dampening (diff) | |
download | frr-d60f63f0872741921d192fa0e9b85d3c11982319.tar.xz frr-d60f63f0872741921d192fa0e9b85d3c11982319.zip |
bgpd: Handle EAD/EVI local route updates on VNI RD change
When VNI RD changes, EAD/EVI routes with old RD should be withdrawn from
the global routing table and EAD/EVI routes in the VNI should be
advertised with the new RD.
Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
Diffstat (limited to 'bgpd/bgp_evpn.c')
-rw-r--r-- | bgpd/bgp_evpn.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 2d4fea413..0d62f26d7 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -3561,8 +3561,12 @@ static int update_advertise_vni_routes(struct bgp *bgp, struct bgpevpn *vpn) const struct prefix_evpn *evp = (const struct prefix_evpn *)bgp_dest_get_prefix(dest); - /* Identify MAC-IP local routes. */ - if (evp->prefix.route_type != BGP_EVPN_MAC_IP_ROUTE) + /* + * We have already processed type-3 routes. + * Process only type-1 and type-2 routes here. + */ + if (evp->prefix.route_type != BGP_EVPN_MAC_IP_ROUTE + && evp->prefix.route_type != BGP_EVPN_AD_ROUTE) continue; for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next) @@ -3580,10 +3584,23 @@ static int update_advertise_vni_routes(struct bgp *bgp, struct bgpevpn *vpn) global_dest = bgp_global_evpn_node_get(bgp->rib[afi][safi], afi, safi, evp, &vpn->prd); assert(global_dest); - update_evpn_route_entry(bgp, vpn, afi, safi, global_dest, attr, 1, - &global_pi, 0, - mac_mobility_seqnum(attr), + + if (evp->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) { + /* Type-2 route */ + update_evpn_route_entry( + bgp, vpn, afi, safi, global_dest, attr, 1, + &global_pi, 0, mac_mobility_seqnum(attr), false /* setup_sync */, NULL /* old_is_sync */); + } else { + /* Type-1 route */ + struct bgp_evpn_es *es; + int route_changed = 0; + + es = bgp_evpn_es_find(&evp->prefix.ead_addr.esi); + bgp_evpn_mh_route_update(bgp, es, vpn, afi, safi, + global_dest, attr, 1, + &global_pi, &route_changed); + } /* Schedule for processing and unlock node. */ bgp_process(bgp, global_dest, afi, safi); @@ -3629,6 +3646,8 @@ static int delete_withdraw_vni_routes(struct bgp *bgp, struct bgpevpn *vpn) bgp_dest_unlock_node(global_dest); } + + delete_global_ead_evi_routes(bgp, vpn); return 0; } |