From 6678277c704c83dc78be6ebc4a338df8503f0654 Mon Sep 17 00:00:00 2001 From: Don Slice Date: Fri, 1 Apr 2016 08:31:40 -0700 Subject: [PATCH] zebra: close all tables when quagga is stopped When signalled to stop quagga, iterate through any "other_tables" that may have been imported and close them all before stopping. Ticket: CM-9386 Signed-off-by: Don Slice Reviewed-by: Donald Sharp --- zebra/zebra_rib.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 8a57473e63..db8966ba7c 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -3692,6 +3692,7 @@ rib_close (void) struct zebra_vrf *zvrf; struct listnode *node; struct interface *ifp; + u_int32_t table_id; for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter)) { @@ -3703,6 +3704,18 @@ rib_close (void) for (ALL_LIST_ELEMENTS_RO (vrf_iter2iflist (iter), node, ifp)) if_nbr_ipv6ll_to_ipv4ll_neigh_del_all(ifp); } + + /* If we do multiple tables per vrf, need to move this to loop above */ + zvrf = vrf_info_lookup (VRF_DEFAULT); + + for (table_id = 0; table_id < ZEBRA_KERNEL_TABLE_MAX; table_id++) + { + if (zvrf->other_table[AFI_IP][table_id]) + rib_close_table (zvrf->other_table[AFI_IP][table_id]); + + if (zvrf->other_table[AFI_IP6][table_id]) + rib_close_table (zvrf->other_table[AFI_IP6][table_id]); + } } /* Routing information base initialize. */ -- 2.39.5