From: Eric Leblond Date: Mon, 5 Nov 2012 21:08:40 +0000 (+0100) Subject: pcap: ref config according to threads count X-Git-Tag: suricata-1.4beta3~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=961eda21089037194667ebad984bb97b557ed8f8;p=thirdparty%2Fsuricata.git pcap: ref config according to threads count --- diff --git a/src/runmode-pcap.c b/src/runmode-pcap.c index afd20ef4b4..aeefbf267c 100644 --- a/src/runmode-pcap.c +++ b/src/runmode-pcap.c @@ -119,7 +119,6 @@ void *ParsePcapConfig(const char *iface) } SC_ATOMIC_INIT(aconf->ref); - (void) SC_ATOMIC_ADD(aconf->ref, 1); aconf->DerefFunc = PcapDerefConfig; aconf->threads = 1; @@ -148,6 +147,8 @@ void *ParsePcapConfig(const char *iface) if (aconf->threads == 0) { aconf->threads = 1; } + (void) SC_ATOMIC_ADD(aconf->ref, aconf->threads); + if (aconf->buffer_size == 0) { const char *s_limit = ConfNodeLookupChildValue(if_root, "buffer-size"); if (s_limit != NULL) {