summaryrefslogtreecommitdiffstats
path: root/src/vnet/bier/bier_table.c
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-01-31 11:35:41 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2018-02-06 12:44:08 +0000
commitf051072f8518097cbce1a8a20510c4e43cb7167c (patch)
tree7d113687fff867ee46013612b3d1693f0cc2aee8 /src/vnet/bier/bier_table.c
parent7e2c31aba2aa9c2ffbcce235a8cc3c673aba2d2e (diff)
BIER: fix support for longer bit-string lengths
Change-Id: I2421197b76be58099e5f8ed5554410adff202109 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/bier/bier_table.c')
-rw-r--r--src/vnet/bier/bier_table.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/vnet/bier/bier_table.c b/src/vnet/bier/bier_table.c
index 0f0f37677e9..80231fd8a72 100644
--- a/src/vnet/bier/bier_table.c
+++ b/src/vnet/bier/bier_table.c
@@ -562,20 +562,22 @@ bier_table_route_add (const bier_table_id_t *btid,
}
void
-bier_table_route_remove (const bier_table_id_t *bti,
+bier_table_route_remove (const bier_table_id_t *btid,
bier_bp_t bp,
fib_route_path_t *brps)
{
fib_route_path_t *brp = NULL;
+ index_t bfmi, bti, bei;
bier_table_t *bt;
- index_t bei;
+ u32 ii;
- bt = bier_table_find(bti);
+ bt = bier_table_find(btid);
if (NULL == bt) {
return;
}
+ bti = bier_table_get_index(bt);
bei = bier_table_lookup(bt, bp);
if (INDEX_INVALID == bei)
@@ -584,9 +586,34 @@ bier_table_route_remove (const bier_table_id_t *bti,
return;
}
- vec_foreach(brp, brps)
+ /*
+ * set the FIB index in the path to the BIER table index
+ */
+ vec_foreach_index(ii, brps)
{
- brp->frp_bier_fib_index = bier_table_get_index(bt);
+ brp = &brps[ii];
+ bfmi = bier_fmask_db_find(bti, brp);
+
+ if (INDEX_INVALID == bfmi)
+ {
+ /*
+ * no matching fmask, not a path we can remove
+ */
+ vec_del1(brps, ii);
+ continue;
+ }
+
+ /*
+ * then modify the path to resolve via this fmask object
+ * and use it to resolve the BIER entry.
+ */
+ brp->frp_flags = FIB_ROUTE_PATH_BIER_FMASK;
+ brp->frp_bier_fmask = bfmi;
+ }
+
+ if (0 == vec_len(brps))
+ {
+ return;
}
if (0 == bier_entry_path_remove(bei, brps))