From: Victor Julien Date: Wed, 20 Jun 2012 15:19:08 +0000 (+0200) Subject: pcap: make sure thread count is 1 if config is missing for a device. X-Git-Tag: suricata-1.3rc1~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0ac64e58ccf704a6daef82c23acb9c919584956;p=thirdparty%2Fsuricata.git pcap: make sure thread count is 1 if config is missing for a device. --- diff --git a/src/flow-timeout.c b/src/flow-timeout.c index e38eae4eb0..3b8858443a 100644 --- a/src/flow-timeout.c +++ b/src/flow-timeout.c @@ -685,7 +685,6 @@ void FlowForceReassemblySetup(void) stream_pseudo_pkt_detect_TV = NULL; } - SCMutexLock(&tv_root_lock); ThreadVars *tv = tv_root[TVT_PPT]; int done = 0; diff --git a/src/runmode-pcap.c b/src/runmode-pcap.c index 63e66cdc2d..f9090d4f3d 100644 --- a/src/runmode-pcap.c +++ b/src/runmode-pcap.c @@ -102,6 +102,7 @@ void *ParsePcapConfig(const char *iface) return NULL; } + memset(aconf, 0x00, sizeof(*aconf)); strlcpy(aconf->iface, iface, sizeof(aconf->iface)); aconf->buffer_size = 0; @@ -120,6 +121,7 @@ void *ParsePcapConfig(const char *iface) SC_ATOMIC_INIT(aconf->ref); SC_ATOMIC_ADD(aconf->ref, 1); aconf->DerefFunc = PcapDerefConfig; + aconf->threads = 1; /* Find initial node */ pcap_node = ConfGetNode("pcap");