From 0dc4e0d1a4375eddef06a57e583dcb387584a049 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Thu, 9 Feb 2023 15:11:40 +0000 Subject: fix: do not always set adj_index of incoming packets Ticket: HICN-839 Change-Id: I67faf5a158a0b58b9ec6d7dfdb234ae3155083b0 Signed-off-by: Mauro Sardara (cherry picked from commit 155af7c9566c254b77ef201ea1a31547b4c95de4) --- hicn-plugin/src/data_input_node.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hicn-plugin/src/data_input_node.c b/hicn-plugin/src/data_input_node.c index dbf49de54..a91f9156d 100644 --- a/hicn-plugin/src/data_input_node.c +++ b/hicn-plugin/src/data_input_node.c @@ -81,13 +81,21 @@ hicn_data_input_set_adj_index (vlib_buffer_t *b, const hicn_dpo_ctx_t *dpo_ctx) { CLIB_UNUSED (u8 set) = 0; + u32 *adj_index = &vnet_buffer (b)->ip.adj_index[VLIB_RX]; + + if (*adj_index != ADJ_INDEX_INVALID) + { + return; + } + for (u8 pos = 0; pos < dpo_ctx->entry_count; pos++) { hicn_face_t *face = hicn_dpoi_get_from_idx (dpo_ctx->next_hops[pos]); assert (face); + if (ip46_address_cmp (&(face->nat_addr), dst_addr) == 0) { - vnet_buffer (b)->ip.adj_index[VLIB_RX] = face->dpo.dpoi_index; + *adj_index = face->dpo.dpoi_index; set = 1; break; } -- cgit 1.2.3-korg