diff options
author | 2019-05-16 11:23:43 +0200 | |
---|---|---|
committer | 2019-05-16 11:23:43 +0200 | |
commit | 05d7122cccb840b2d096dc6deb32dcafc3dd04db (patch) | |
tree | f5ce60394784b0ae9831b32a1a47d30a7e249d9a /hicn-plugin/src/pcs.h | |
parent | 3c8e286dbc17e85eaa5b90cd4e5d7b88d9d18391 (diff) |
[HICN-197] Fixed missing deallocation when data was pushed from a local application
Change-Id: I9f7d8bf0ffbebd43ee82112407da39473fa2ad7c
Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin/src/pcs.h')
-rw-r--r-- | hicn-plugin/src/pcs.h | 6 |
1 files 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; } } |