summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/route.c
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2020-01-21 18:04:48 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2020-01-21 18:04:48 +0100
commit731a7efa3fa58d0fee89c93d613e11d8b4108c89 (patch)
tree3b2859b7be2b526a45aa4010e7e4b4aa423afedd /hicn-plugin/src/route.c
parentbf366088b56e7f2e793e7026d9c655e26fe4a67a (diff)
[HICN-485] Fixed entry deletion when the last nh is removed
Change-Id: I1a3353989f934f135b4226a6af68a09dd8749563 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin/src/route.c')
-rw-r--r--hicn-plugin/src/route.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hicn-plugin/src/route.c b/hicn-plugin/src/route.c
index e5758eed4..5ece5cfdb 100644
--- a/hicn-plugin/src/route.c
+++ b/hicn-plugin/src/route.c
@@ -288,8 +288,13 @@ hicn_route_del_nhop (fib_prefix_t * prefix, hicn_face_id_t face_id)
{
vft_id = hicn_dpo_get_vft_id (hicn_dpo_id);
dpo_vft = hicn_dpo_get_vft (vft_id);
- return dpo_vft->hicn_dpo_del_nh (face_id, hicn_dpo_id->dpoi_index,
- prefix);
+ ret = dpo_vft->hicn_dpo_del_nh (face_id, hicn_dpo_id->dpoi_index,
+ prefix);
+
+ hicn_dpo_ctx_t * dpo_ctx = dpo_vft->hicn_dpo_get_ctx(hicn_dpo_id->dpoi_index);
+
+ if (ret == HICN_ERROR_NONE && !dpo_ctx->entry_count)
+ ret = hicn_route_del(prefix);
}
//Remember to remove the lock from the table when removing the entry
return ret;