From 05d7122cccb840b2d096dc6deb32dcafc3dd04db Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Thu, 16 May 2019 11:23:43 +0200 Subject: [HICN-197] Fixed missing deallocation when data was pushed from a local application Change-Id: I9f7d8bf0ffbebd43ee82112407da39473fa2ad7c Signed-off-by: Alberto Compagno --- hicn-plugin/src/pcs.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hicn-plugin/src/pcs.h b/hicn-plugin/src/pcs.h index 549edae01..f87cccf8a 100644 --- a/hicn-plugin/src/pcs.h +++ b/hicn-plugin/src/pcs.h @@ -495,14 +495,16 @@ hicn_pcs_cs_delete (vlib_main_t * vm, hicn_pit_cs_t * pitcs, /* Update the global CS counter */ pitcs->pcs_cs_count--; } - hash_entry->locks--; - if (hash_entry->locks == 0) + + /* A data could have been inserted in the CS through a push. In this case locks == 0 */ + if (hash_entry->locks == 0 || hash_entry->locks == 1) { hicn_pcs_delete_internal (pitcs, pcs_entryp, hash_entry, nodep, vm, dpo_vft, hicn_dpo_id); } else { + hash_entry->locks--; hash_entry->he_flags |= HICN_HASH_ENTRY_FLAG_DELETED; } } -- cgit 1.2.3-korg