diff options
Diffstat (limited to 'hicn-plugin/src')
-rw-r--r-- | hicn-plugin/src/hicn_api.c | 4 | ||||
-rw-r--r-- | hicn-plugin/src/route.c | 9 | ||||
-rw-r--r-- | hicn-plugin/src/strategies/dpo_mw.c | 8 | ||||
-rw-r--r-- | hicn-plugin/src/strategies/dpo_rr.c | 6 |
4 files changed, 10 insertions, 17 deletions
diff --git a/hicn-plugin/src/hicn_api.c b/hicn-plugin/src/hicn_api.c index 806de2b4e..639840647 100644 --- a/hicn-plugin/src/hicn_api.c +++ b/hicn-plugin/src/hicn_api.c @@ -474,12 +474,12 @@ send_faces_details (vl_api_registration_t * reg, if (face->shared.face_type == hicn_face_ip_type) { - mp->type = IP_FACE; + mp->type = clib_host_to_net_u32(IP_FACE); send_face_ip_details (face, &(mp->face.ip)); } else if (face->shared.face_type == hicn_face_udp_type) { - mp->type = UDP_FACE; + mp->type = clib_host_to_net_u32(UDP_FACE); send_face_udp_details (face, &(mp->face.udp)); } 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; diff --git a/hicn-plugin/src/strategies/dpo_mw.c b/hicn-plugin/src/strategies/dpo_mw.c index dfdde3681..3317d31e0 100644 --- a/hicn-plugin/src/strategies/dpo_mw.c +++ b/hicn-plugin/src/strategies/dpo_mw.c @@ -258,7 +258,7 @@ hicn_strategy_mw_ctx_del_nh (hicn_face_id_t face_id, index_t dpo_idx, int ret = HICN_ERROR_DPO_CTX_NOT_FOUND; dpo_id_t invalid = NEXT_HOP_INVALID; - if (hicn_strategy_mw_ctx != NULL) + if (hicn_strategy_mw_ctx == NULL) return HICN_ERROR_STRATEGY_NOT_FOUND; for (int i = 0; i < hicn_strategy_mw_ctx->default_ctx.entry_count; i++) @@ -276,12 +276,6 @@ hicn_strategy_mw_ctx_del_nh (hicn_face_id_t face_id, index_t dpo_idx, } } - if (0 == hicn_strategy_mw_ctx->default_ctx.entry_count) - { - fib_table_entry_special_remove (HICN_FIB_TABLE, fib_pfx, - FIB_SOURCE_PLUGIN_HI); - } - return ret; } diff --git a/hicn-plugin/src/strategies/dpo_rr.c b/hicn-plugin/src/strategies/dpo_rr.c index 4cddd513c..dfdc83ff4 100644 --- a/hicn-plugin/src/strategies/dpo_rr.c +++ b/hicn-plugin/src/strategies/dpo_rr.c @@ -279,12 +279,6 @@ hicn_strategy_rr_ctx_del_nh (hicn_face_id_t face_id, index_t dpo_idx, } } - if (0 == hicn_strategy_rr_ctx->default_ctx.entry_count) - { - fib_table_entry_special_remove (HICN_FIB_TABLE, fib_pfx, - FIB_SOURCE_PLUGIN_HI); - } - return ret; } |