*/
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.
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 *);
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)
{