diff options
author | vivek <vivek@cumulusnetworks.com> | 2017-05-15 23:31:57 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-07-12 18:39:11 +0200 |
commit | abddf7583c3f174aec7d4d6cdbef6dc15fb07723 (patch) | |
tree | 9ae85bf9955b4facd24fd11f4d80a390d30d73be /bgpd | |
parent | bgpd: Implement EVPN enable/disable (diff) | |
download | frr-abddf7583c3f174aec7d4d6cdbef6dc15fb07723.tar.xz frr-abddf7583c3f174aec7d4d6cdbef6dc15fb07723.zip |
bgpd: Install or remove only relevant routes from zebra
Ensure that the AFI/SAFI is relevant to the FIB before attempting to install
or remove the route from zebra.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_route.c | 12 | ||||
-rw-r--r-- | bgpd/bgp_routemap.c | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index d72da431f..ca6d138ea 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -1933,7 +1933,8 @@ bgp_process_main (struct work_queue *wq, void *data) for (afi = AFI_IP; afi < AFI_MAX; afi++) for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { - bgp_zebra_announce_table(bgp, afi, safi); + if (bgp_fibupd_safi(safi)) + bgp_zebra_announce_table(bgp, afi, safi); } bgp->main_peers_update_hold = 0; @@ -3562,7 +3563,8 @@ bgp_cleanup_table(struct bgp_table *table, safi_t safi) && (ri->sub_type == BGP_ROUTE_NORMAL || ri->sub_type == BGP_ROUTE_AGGREGATE)) { - bgp_zebra_withdraw (&rn->p, ri, safi); + if (bgp_fibupd_safi(safi)) + bgp_zebra_withdraw (&rn->p, ri, safi); bgp_info_reap (rn, ri); } } @@ -4787,7 +4789,8 @@ bgp_table_map_set (struct vty *vty, afi_t afi, safi_t safi, rmap->map = NULL; } - bgp_zebra_announce_table(bgp, afi, safi); + if (bgp_fibupd_safi(safi)) + bgp_zebra_announce_table(bgp, afi, safi); return CMD_SUCCESS; } @@ -4805,7 +4808,8 @@ bgp_table_map_unset (struct vty *vty, afi_t afi, safi_t safi, rmap->name = NULL; rmap->map = NULL; - bgp_zebra_announce_table(bgp, afi, safi); + if (bgp_fibupd_safi(safi)) + bgp_zebra_announce_table(bgp, afi, safi); return CMD_SUCCESS; } diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index f2c94371a..b0a3cc677 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -3112,6 +3112,9 @@ bgp_route_map_process_update (struct bgp *bgp, const char *rmap_name, int route_ for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { /* For table route-map updates. */ + if (!bgp_fibupd_safi(safi)) + continue; + if (bgp->table_map[afi][safi].name && (strcmp(rmap_name, bgp->table_map[afi][safi].name) == 0)) { |