aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/route.c
diff options
context:
space:
mode:
authorMichele Papalini <micpapal@cisco.com>2023-02-10 09:18:29 +0000
committerGerrit Code Review <gerrit@fd.io>2023-02-10 09:18:29 +0000
commitf0c5b3f6a6ba79eacb29552522e30cfaa2b125c3 (patch)
treec178c342ae1a6f344eb56871ccdc72e6dfd300d4 /hicn-plugin/src/route.c
parente831c121d672b9d15cdf0eaa86ce1dd5a8ce86d8 (diff)
parentbdb0e36e9b740c80dfdd39c0d144e66699de8a14 (diff)
Merge "feat(hicn-plugin): specify the dpo_proto when creating a new face" into stable/2210
Diffstat (limited to 'hicn-plugin/src/route.c')
-rw-r--r--hicn-plugin/src/route.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/hicn-plugin/src/route.c b/hicn-plugin/src/route.c
index ff96e5cd7..2509628d9 100644
--- a/hicn-plugin/src/route.c
+++ b/hicn-plugin/src/route.c
@@ -231,11 +231,11 @@ sync_hicn_fib_entry (hicn_dpo_ctx_t *fib_entry, hicn_face_id_t **pvec_faces)
const dpo_id_t *former_dpo = &temp;
int index = 0;
-#define ADD_FACE(nh) \
+#define ADD_FACE(nh, dpo_proto) \
do \
{ \
/* Careful, this adds a lock on the face if it exists */ \
- hicn_face_add (dpo, nh, sw_if, &face_id); \
+ hicn_face_add (dpo, nh, sw_if, &face_id, dpo_proto); \
ASSERT (face_id != HICN_FACE_NULL); \
vec_validate (vec_faces, index); \
vec_faces[index] = face_id; \
@@ -272,7 +272,7 @@ sync_hicn_fib_entry (hicn_dpo_ctx_t *fib_entry, hicn_face_id_t **pvec_faces)
sw_if = adj->rewrite_header.sw_if_index;
nh = get_address (&(adj->sub_type.nbr.next_hop), sw_if,
fib_entry->proto);
- ADD_FACE (nh);
+ ADD_FACE (nh, dpo->dpoi_proto);
HICN_DEBUG ("Added new HICN face: %d because of route prefix %U",
face_id, format_fib_prefix, &_fib_entry->fe_prefix);
}
@@ -285,11 +285,11 @@ sync_hicn_fib_entry (hicn_dpo_ctx_t *fib_entry, hicn_face_id_t **pvec_faces)
{
case FIB_PROTOCOL_IP6:
ip46_address_set_ip6 (nh, &localhost6);
- ADD_FACE (nh);
+ ADD_FACE (nh, DPO_PROTO_IP6);
break;
case FIB_PROTOCOL_IP4:
ip46_address_set_ip4 (nh, &localhost4);
- ADD_FACE (nh);
+ ADD_FACE (nh, DPO_PROTO_IP4);
break;
default:
continue;
@@ -302,7 +302,7 @@ sync_hicn_fib_entry (hicn_dpo_ctx_t *fib_entry, hicn_face_id_t **pvec_faces)
else if (dpo_is_pgserver (dpo))
{
hicnpg_server_t *pg_server = hicnpg_server_get (dpo->dpoi_index);
- ADD_FACE (&pg_server->hicn_locator);
+ ADD_FACE (&pg_server->hicn_locator, dpo->dpoi_proto);
}
}
@@ -370,7 +370,7 @@ disable_data_receiving_rm_fib_entry (vnet_main_t *vnm, vnet_sw_interface_t *si,
}
int
-hicn_route_enable (fib_prefix_t *prefix, hicn_face_id_t **pvec_faces)
+hicn_route_enable (const fib_prefix_t *prefix, hicn_face_id_t **pvec_faces)
{
int ret = HICN_ERROR_NONE;
@@ -464,7 +464,7 @@ hicn_route_enable (fib_prefix_t *prefix, hicn_face_id_t **pvec_faces)
*/
vnet_main_t *vnm = vnet_get_main ();
vnet_sw_interface_walk (vnm, enable_data_receiving_new_fib_entry,
- &(prefix->fp_proto));
+ (void *) (&prefix->fp_proto));
dpo_unlock (&dpo);
}