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-10 09:15:06 +0000
commit0dc4e0d1a4375eddef06a57e583dcb387584a049 (patch)
tree53db07ac6f72ef1ca3e7123b9d0761a9f3894f6a
parent0ac147d632ed6a150bf0216964888a21b1c8d43c (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> (cherry picked from commit 155af7c9566c254b77ef201ea1a31547b4c95de4)
-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;
}