]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: close all tables when quagga is stopped
authorDon Slice <dslice@cumulusnetworks.com>
Fri, 1 Apr 2016 15:31:40 +0000 (08:31 -0700)
committerDon Slice <dslice@cumulusnetworks.com>
Fri, 1 Apr 2016 23:12:33 +0000 (16:12 -0700)
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

index 8a57473e6369d9d857f8d1bb364b4426fbaf30c1..db8966ba7cdc8de05d00c29098154213fcb4c6ba 100644 (file)
@@ -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. */