Squashed commit of the following:
commit
ce792e96a5d6abf2d1804c90e738487061616700
Author: Shravan Rangaraju <shrarang@cisco.com>
Date: Fri Jan 10 11:26:32 2020 -0500
appid: do not reload third party on reload_config
SnortProtocolId snortId_for_ftp_data;
SnortProtocolId snortId_for_http2;
+#ifdef ENABLE_APPID_THIRD_PARTY
+ThirdPartyAppIdContext* AppIdContext::tp_appid_ctxt = nullptr;
+#endif
+
static void map_app_names_to_snort_ids(SnortConfig* sc)
{
/* init globals for snortId compares */
AppIdContext(AppIdConfig* config) : config(config)
{ }
- ~AppIdContext()
- {
-#ifdef ENABLE_APPID_THIRD_PARTY
- delete tp_appid_ctxt;
-#endif
- }
+ ~AppIdContext() { }
#ifdef ENABLE_APPID_THIRD_PARTY
ThirdPartyAppIdContext* get_tp_appid_ctxt() const
{ return tp_appid_ctxt; }
+ static void delete_tp_appid_ctxt()
+ { delete tp_appid_ctxt; }
+
void create_tp_appid_ctxt();
#endif
// removed from AppIdContext::pterm
static AppInfoManager& app_info_mgr;
#ifdef ENABLE_APPID_THIRD_PARTY
- ThirdPartyAppIdContext* tp_appid_ctxt = nullptr;
+ static ThirdPartyAppIdContext* tp_appid_ctxt;
#endif
};
else
{
Swapper::set_reload_in_progress(true);
- LogMessage(".. reloading third-party");
+ LogMessage(".. reloading third-party\n");
AppIdInspector* inspector = (AppIdInspector*) InspectorManager::get_inspector(MOD_NAME, true);
AppIdContext* ctxt = inspector->get_ctxt();
ctxt->create_tp_appid_ctxt();
Swapper::set_reload_in_progress(false);
+ LogMessage("== reload third-party complete\n");
}
#else
LogMessage("== third party is not enabled\n");
TPLibHandler* tph = nullptr;
+#ifdef ENABLE_APPID_THIRD_PARTY
+ThirdPartyAppIdContext* AppIdContext::tp_appid_ctxt = nullptr;
+#endif
+
AppIdConfig::~AppIdConfig() { }
TEST_GROUP(tp_lib_handler)
if (ret != 0)
ErrorMessage("Could not terminate 3rd party AppID module (%d)!\n", ret);
+ AppIdContext::delete_tp_appid_ctxt();
+
// FIXIT-L: Find the right place to dlclose self->tp_so_handle. dlclose here was causing
// segfault