BIER; bi-dir to/from underlay
[vpp.git] / src / vnet / bier / bier_imp.c
index bd934b7..87a8f90 100644 (file)
@@ -68,7 +68,7 @@ bier_imp_add_or_lock (const bier_table_id_t *bti,
     pool_get_aligned(bier_imp_pool, bi, CLIB_CACHE_LINE_BYTES);
 
     bi->bi_tbl = *bti;
-    btii = bier_table_add_or_lock(bti, MPLS_LABEL_INVALID);
+    btii = bier_table_lock(bti);
 
     /*
      * init the BIER header we will paint on in the data plane
@@ -275,8 +275,15 @@ show_bier_imp (vlib_main_t * vm,
     }
     else
     {
-        vlib_cli_output(vm, "%U", format_bier_imp, bii, 1,
-                        BIER_SHOW_DETAIL);
+        if (pool_is_free_index(bier_imp_pool, bii))
+        {
+            vlib_cli_output(vm, "No such BIER imposition: %d", bii);
+        }
+        else
+        {
+            vlib_cli_output(vm, "%U", format_bier_imp, bii, 1,
+                            BIER_SHOW_DETAIL);
+        }
     }
     return (NULL);
 }