*
* A BIER imposition object is present in the IP mcast output list
* and represents the imposition of a BIER bitmask. After BIER header
- * imposition the packet is forward within the appropriate/specifid
+ * imposition the packet is forward within the appropriate/specified
* BIER table
*/
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
0, // entropy
sender);
bier_hdr_hton(&bi->bi_hdr);
- clib_memcpy(&bi->bi_bits, bs->bbs_buckets, bs->bbs_len);
+ clib_memcpy_fast(&bi->bi_bits, bs->bbs_buckets, bs->bbs_len);
bier_imp_lock_i(bi);
if (INDEX_INVALID == bii)
{
- pool_foreach(bi, bier_imp_pool,
- ({
+ pool_foreach (bi, bier_imp_pool)
+ {
vlib_cli_output(vm, "%U", format_bier_imp,
bier_imp_get_index(bi),
1,
BIER_SHOW_BRIEF);
- }));
+ }
}
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);
}