acl-plugin: Stale classify table after deleting macip ACL 73/10473/2
authorSteve Shin <jonshin@cisco.com>
Fri, 9 Feb 2018 06:39:02 +0000 (22:39 -0800)
committerDamjan Marion <dmarion.lists@gmail.com>
Fri, 9 Feb 2018 13:29:32 +0000 (13:29 +0000)
Classify table for output node should be cleaned up
after deleting macip ACL.

Change-Id: Ibbc46c8465bec02fe6fa6a8d33a1f06bcf28e9ad
Signed-off-by: Steve Shin <jonshin@cisco.com>
src/plugins/acl/acl.c

index 82a5670..169dc12 100644 (file)
@@ -1852,6 +1852,24 @@ macip_destroy_classify_tables (acl_main_t * am, u32 macip_acl_index)
                                        0);
       a->l2_table_index = ~0;
     }
+  if (a->out_ip4_table_index != ~0)
+    {
+      acl_classify_add_del_table_small (cm, 0, ~0, ~0, ~0,
+                                       &a->out_ip4_table_index, 0);
+      a->out_ip4_table_index = ~0;
+    }
+  if (a->out_ip6_table_index != ~0)
+    {
+      acl_classify_add_del_table_small (cm, 0, ~0, ~0, ~0,
+                                       &a->out_ip6_table_index, 0);
+      a->out_ip6_table_index = ~0;
+    }
+  if (a->out_l2_table_index != ~0)
+    {
+      acl_classify_add_del_table_small (cm, 0, ~0, ~0, ~0,
+                                       &a->out_l2_table_index, 0);
+      a->out_l2_table_index = ~0;
+    }
 }
 
 static int
@@ -3032,6 +3050,10 @@ macip_acl_print (acl_main_t * am, u32 macip_acl_index)
   vlib_main_t *vm = am->vlib_main;
   int i;
 
+  /* Don't attempt to show the ACLs that do not exist */
+  if (pool_is_free_index (am->macip_acls, macip_acl_index))
+    return;
+
   /* Don't try to print someone else's memory */
   if (macip_acl_index > vec_len (am->macip_acls))
     return;