From: Donald Sharp Date: Fri, 16 Mar 2018 04:07:45 +0000 (-0400) Subject: zebra: Cleanup dead function rib_weed_table X-Git-Tag: frr-5.0-dev~138^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=ea7637ccd4c6fc716ae2c11b1801bca4f60ca6e0;p=mirror%2Ffrr.git zebra: Cleanup dead function rib_weed_table the rib_wib_table function was uncalled by anyone remove and additionally remove it's static function it called. Signed-off-by: Donald Sharp --- diff --git a/zebra/main.c b/zebra/main.c index 00d853ea26..b0a19c5aa5 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -351,9 +351,6 @@ int main(int argc, char **argv) */ frr_config_fork(); - /* Clean up rib -- before fork (?) */ - /* rib_weed_tables (); */ - /* After we have successfully acquired the pidfile, we can be sure * about being the only copy of zebra process, which is submitting * changes to the FIB. diff --git a/zebra/rib.h b/zebra/rib.h index 44e0a9ce40..b244bde9b9 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -324,7 +324,6 @@ extern struct route_entry *rib_match_ipv4_multicast(vrf_id_t vrf_id, extern struct route_entry *rib_lookup_ipv4(struct prefix_ipv4 *, vrf_id_t); extern void rib_update(vrf_id_t, rib_update_event_t); -extern void rib_weed_tables(void); extern void rib_sweep_route(void); extern void rib_sweep_table(struct route_table *); extern void rib_close_table(struct route_table *); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 73b20320ad..bba0f81868 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2703,38 +2703,6 @@ void rib_update(vrf_id_t vrf_id, rib_update_event_t event) rib_update_table(table, event); } -/* Remove all routes which comes from non main table. */ -static void rib_weed_table(struct route_table *table) -{ - struct route_node *rn; - struct route_entry *re; - struct route_entry *next; - - if (table) - for (rn = route_top(table); rn; rn = srcdest_route_next(rn)) - RNODE_FOREACH_RE_SAFE (rn, re, next) { - if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED)) - continue; - - if (re->table != zebrad.rtm_table_default - && re->table != RT_TABLE_MAIN) - rib_delnode(rn, re); - } -} - -/* Delete all routes from non main table. */ -void rib_weed_tables(void) -{ - struct vrf *vrf; - struct zebra_vrf *zvrf; - - RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) - if ((zvrf = vrf->info) != NULL) { - rib_weed_table(zvrf->table[AFI_IP][SAFI_UNICAST]); - rib_weed_table(zvrf->table[AFI_IP6][SAFI_UNICAST]); - } -} - /* Delete self installed routes after zebra is relaunched. */ void rib_sweep_table(struct route_table *table) {