aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/pcs.h
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2023-01-20 18:43:11 +0000
committerGerrit Code Review <gerrit@fd.io>2023-01-20 18:43:11 +0000
commitf8a9c5b1a768ba01cff6738176b4ff7d5a5017bd (patch)
tree7d77bcf5df5a563c1da6bc389a7551769a202fbb /hicn-plugin/src/pcs.h
parentda0d60997bce1e40cc0b1c7b7f4f58df56bbead3 (diff)
parent64fa723904d35eda3406058469b890a39c3f628c (diff)
Merge "fix(hicn-plugin): handle inflight interest coming from deleted face" into stable/2210
Diffstat (limited to 'hicn-plugin/src/pcs.h')
-rw-r--r--hicn-plugin/src/pcs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/hicn-plugin/src/pcs.h b/hicn-plugin/src/pcs.h
index 0b7635100..86fb72cc9 100644
--- a/hicn-plugin/src/pcs.h
+++ b/hicn-plugin/src/pcs.h
@@ -377,6 +377,16 @@ hicn_pcs_entry_get_entry_from_index (const hicn_pit_cs_t *pitcs, u32 index)
return pool_elt_at_index (pitcs->pcs_entries_pool, index);
}
+always_inline hicn_pcs_entry_t *
+hicn_pcs_entry_get_entry_from_index_safe (const hicn_pit_cs_t *pitcs,
+ u32 index)
+{
+ if (!pool_is_free_index (pitcs->pcs_entries_pool, index))
+ return pool_elt_at_index (pitcs->pcs_entries_pool, index);
+
+ return NULL;
+}
+
/*
* Check if pcs entry is a content store entry
*/