summaryrefslogtreecommitdiffstats
path: root/src/vnet/bier/bier_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/bier/bier_api.c')
-rw-r--r--src/vnet/bier/bier_api.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/vnet/bier/bier_api.c b/src/vnet/bier/bier_api.c
index 93048a0a890..2e8fc626baa 100644
--- a/src/vnet/bier/bier_api.c
+++ b/src/vnet/bier/bier_api.c
@@ -204,13 +204,24 @@ vl_api_bier_route_add_del_t_handler (vl_api_bier_route_add_del_t * mp)
}
}
- if (mp->br_is_add)
+ if (mp->br_is_replace)
{
- bier_table_route_add(&bti, bp, brpaths);
+ if (0 == vec_len(brpaths))
+ {
+ bier_table_route_delete(&bti, bp);
+ }
+ else
+ {
+ bier_table_route_path_update(&bti, bp, brpaths);
+ }
+ }
+ else if (mp->br_is_add)
+ {
+ bier_table_route_path_add(&bti, bp, brpaths);
}
else
{
- bier_table_route_remove(&bti, bp, brpaths);
+ bier_table_route_path_remove(&bti, bp, brpaths);
}
vec_free(brpaths);