]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2103 in SNORT/snort3 from ~NEHASH4/snort3:CSCvt32429 to master
authorGeorge Koikara (gkoikara) <gkoikara@cisco.com>
Wed, 1 Apr 2020 14:51:41 +0000 (14:51 +0000)
committerGeorge Koikara (gkoikara) <gkoikara@cisco.com>
Wed, 1 Apr 2020 14:51:41 +0000 (14:51 +0000)
Squashed commit of the following:

commit fc824674b7f4d878f4dfa7ed54bb4702f6a1aae5
Author: neha sharma <nehash4@cisco.com>
Date:   Sun Mar 22 05:05:20 2020 -0400

    file: apply cached verdict on already seen file

src/file_api/file_flows.cc

index b1d60e8fa2b54a600101083da187aa60ba08bacb..97687a216af6db6c2e489eca0238f72c226958aa 100644 (file)
@@ -277,6 +277,15 @@ bool FileFlows::file_process(Packet* p, uint64_t file_id, const uint8_t* file_da
         context->set_file_id(file_id);
     }
 
+    if ( offset != 0 and
+        (FileService::get_file_cache()->cached_verdict_lookup(p, context, file_policy) !=
+            FILE_VERDICT_UNKNOWN) )
+    {
+        context->processing_complete = true;
+        remove_processed_file_context(multi_file_processing_id);
+        return false;
+    }
+
     if (context->processing_complete and context->verdict != FILE_VERDICT_UNKNOWN)
     {
         /*A new file session, but policy might be different*/