Merge in SNORT/snort3 from ~SHINAGPA/snort3:mp_file_fix to master
Squashed commit of the following:
commit
b72873ff0d9785dad40e2fd293aab1c697b10c06
Author: Shilpa Nagpal <shinagpa@cisco.com>
Date: Mon Jul 28 16:17:08 2025 +0530
file_api: multi-process snort file cache crash fix
if (to_create and !file)
file = add(hashKey, timeout, cache_full, cache_expire);
+ if (file and !file->get_config())
+ {
+ FileConfig *fc = get_file_config(SnortConfig::get_conf());
+ file->set_config(fc);
+ }
return file;
}
FileCache* file_cache = FileService::get_file_cache();
assert(file_cache);
context = file_cache->get_file(flow, file_id, false, true);
- if (context)
- {
- FileConfig *fc = get_file_config(SnortConfig::get_conf());
-
- if (!context->get_config())
- context->set_config(fc);
- }
FILE_DEBUG(file_trace, DEFAULT_TRACE_OPTION_ID, TRACE_DEBUG_LEVEL, GET_CURRENT_PACKET,
"get_file_context:trying to get context from cache\n");
}