aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2016-11-23 16:31:57 -0800
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2016-11-24 00:33:14 +0000
commit7dbe9b49879e06e1d86c11140e2bfdacbabde74b (patch)
tree6d61e4b5682922776b673c5b9a13a860708c811f /epan
parent76c39702656a34d9343719013457a321add5018a (diff)
Return from snort_start early if dissector not enabled.
Change-Id: Idf63210ce33d92ac8619fe3295bd3e6c0bb304a9 Reviewed-on: https://code.wireshark.org/review/18941 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-snort.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/epan/dissectors/packet-snort.c b/epan/dissectors/packet-snort.c
index 4bed149eda..a37e60800f 100644
--- a/epan/dissectors/packet-snort.c
+++ b/epan/dissectors/packet-snort.c
@@ -1061,13 +1061,6 @@ snort_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return tvb_reported_length(tvb);
}
-/* N.B. is being called.. */
-static void snort_config(gpointer user_data _U_)
-{
- /* N.B. original code tried to get line-buffered (or unbuffered) output from snort.
- It wasn't very portable, and measurements indicated it didn't make any difference
- to how often whole lines were output. */
-}
/*------------------------------------------------------------------*/
/* Start up Snort. */
@@ -1088,6 +1081,11 @@ static void snort_start(void)
NULL
};
+ /* Nothing to do if not enabled, but registered init function gets called anyway */
+ if (!snort_enable_dissector) {
+ return;
+ }
+
/* Create tree mapping packet_number -> Alerts_t*. It will get recreated when packet list is reloaded */
current_session.alerts_tree = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
@@ -1123,7 +1121,7 @@ static void snort_start(void)
(char **)argv,
NULL, /* envp */
(GSpawnFlags)( G_SPAWN_DO_NOT_REAP_CHILD), /* Leave out G_SPAWN_SEARCH_PATH */
- snort_config, /* child setup - not currently doing anything.. */
+ NULL, /* child setup - not currently doing anything.. */
NULL, /* user-data */
&current_session.pid, /* PID */
&current_session.in, /* stdin */