diff options
author | Mitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com> | 2018-04-11 11:29:46 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-05-09 01:24:15 +0200 |
commit | 2b659f33296f425e54410ceb08741da5d5d53d00 (patch) | |
tree | c5ffda8a0be35bbb3150c1ea3d2810e564b845d0 /bgpd/bgp_route.c | |
parent | bgpd: apply advertise ipv4 unicast route-map while advertising type-5 routes (diff) | |
download | frr-2b659f33296f425e54410ceb08741da5d5d53d00.tar.xz frr-2b659f33296f425e54410ceb08741da5d5d53d00.zip |
bgpd: modify route install/withdraw logic for evpn type-5 routes in vrf
We install type-5 routes as ipv4/ipv6 unicast routes in the vrf table.
along with these routes, we also install the RMAC
and the nexthop Neigh entries.
There might be scenarios were the bestpath has changed and
we are now pointing to a new nexthop with a different RMAC.
As per BGP logic, we just send an update for the route and the nexthop
is replaced. However, this causes problem because the RMAC and neigh entry
corresponding to the previous nexthop are still lingering in the system.
We need to clear those entries for proper functoning.
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r-- | bgpd/bgp_route.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 2a4eab0ad..19af159be 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2336,10 +2336,18 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_node *rn, if (new_select && new_select->type == ZEBRA_ROUTE_BGP && (new_select->sub_type == BGP_ROUTE_NORMAL || new_select->sub_type == BGP_ROUTE_AGGREGATE - || new_select->sub_type == BGP_ROUTE_IMPORTED)) + || new_select->sub_type == BGP_ROUTE_IMPORTED)) { + + /* if this is an evpn imported type-5 prefix, + * we need to withdraw the route first to clear + * the nh neigh and the RMAC entry. + */ + if (old_select && + is_route_parent_evpn(old_select)) + bgp_zebra_withdraw(p, old_select, bgp, safi); bgp_zebra_announce(rn, p, new_select, bgp, afi, safi); - else { + } else { /* Withdraw the route from the kernel. */ if (old_select && old_select->type == ZEBRA_ROUTE_BGP && (old_select->sub_type == BGP_ROUTE_NORMAL |