]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2408 in SNORT/snort3 from ~KBHANDAN/snort3:whd_reload to master
authorBhargava Jandhyala (bjandhya) <bjandhya@cisco.com>
Wed, 19 Aug 2020 07:15:12 +0000 (07:15 +0000)
committerBhargava Jandhyala (bjandhya) <bjandhya@cisco.com>
Wed, 19 Aug 2020 07:15:12 +0000 (07:15 +0000)
Squashed commit of the following:

commit ffbbe26f3beb7a46b5bd3b9f2b28d3a2b8092a7a
Author: Kaushal Bhandankar <kbhandan@cisco.com>
Date:   Tue Aug 18 08:56:11 2020 -0400

    flow: reset the flow before removing

src/flow/flow_cache.cc

index aeadfd621f5f61bfa04f6527255b9ff844feafa7..ee29e4335eb83942b1cdea6c788f5ae929cb07d4 100644 (file)
@@ -375,7 +375,6 @@ unsigned FlowCache::delete_active_flows(unsigned mode, unsigned num_to_delete, u
         }
 
         // we have a winner...
-        hash_table->remove();
         if ( flow->next )
             unlink_uni(flow);
 
@@ -386,6 +385,9 @@ unsigned FlowCache::delete_active_flows(unsigned mode, unsigned num_to_delete, u
         else
             delete_stats.update(FlowDeleteState::ALLOWED);
 
+        flow->reset(true);
+        //The flow should not be removed from the hash before reset
+        hash_table->remove();
         delete flow;
         memory::MemoryCap::update_deallocations(sizeof(HashNode) + sizeof(FlowKey));
         --flows_allocated;