aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2023-02-09 15:11:40 +0000
committerMauro Sardara <msardara@cisco.com>2023-02-09 15:15:27 +0000
commit155af7c9566c254b77ef201ea1a31547b4c95de4 (patch)
treeb709f0230b7d7226f8084b9f6e1852e84b7e266e
parent49776ceac54eecadabca6c0e2fdc0b9ee2e8e663 (diff)
fix: do not always set adj_index of incoming packets
Ticket: HICN-839 Change-Id: I67faf5a158a0b58b9ec6d7dfdb234ae3155083b0 Signed-off-by: Mauro Sardara <msardara@cisco.com>
-rw-r--r--hicn-plugin/src/data_input_node.c10
1 files changed, 9 insertions, 1 deletions
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;
}