diff --git a/dp-core/vr_flow.c b/dp-core/vr_flow.c index b9de76629..da4b4518f 100644 --- a/dp-core/vr_flow.c +++ b/dp-core/vr_flow.c @@ -224,7 +224,6 @@ __vr_flow_reset_entry(struct vrouter *router, struct vr_flow_entry *fe) (VR_FLOW_FLAG_ACTIVE | VR_FLOW_FLAG_EVICTED | VR_FLOW_FLAG_NEW_FLOW); - vr_htable_release_hentry(router->vr_flow_table, &fe->fe_hentry); return; } diff --git a/dp-core/vr_htable.c b/dp-core/vr_htable.c index afe444321..c25fbb5dc 100644 --- a/dp-core/vr_htable.c +++ b/dp-core/vr_htable.c @@ -165,11 +165,12 @@ vr_htable_hentry_invalidate(struct vr_htable *table, vr_hentry_t *ent) if (!table || !ent) return; - ent->hentry_next_index = VR_INVALID_HENTRY_INDEX; ent->hentry_bucket_index = VR_INVALID_HENTRY_INDEX; - if (ent->hentry_index >= table->ht_hentries) + if (ent->hentry_index >= table->ht_hentries) { + ent->hentry_next_index = VR_INVALID_HENTRY_INDEX; vr_htable_put_free_oentry(table, ent); + } ent->hentry_flags &= VR_HENTRY_FLAG_IN_FREE_LIST; } @@ -186,7 +187,7 @@ __vr_htable_hentry_invalidate(struct vr_htable *table, vr_hentry_t *ent) return; if (ent->hentry_index >= table->ht_hentries) { - head_ent = vr_htable_get_hentry_by_index((vr_htable_t)table, + head_ent = __vr_htable_get_hentry_by_index((vr_htable_t)table, ent->hentry_bucket_index); for (prev = head_ent; prev; prev = prev->hentry_next) { if (prev->hentry_next == ent) {