From: Victor Julien Date: Mon, 17 Feb 2014 09:51:12 +0000 (+0100) Subject: pcap/afpacket: update counters at exit X-Git-Tag: suricata-2.0rc2~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e561d6b206443190b1df5b83ff7e3e4adac823c;p=thirdparty%2Fsuricata.git pcap/afpacket: update counters at exit In really short Suricata runtimes the capture counters would not be updated. This patch does a force update at the end of the capture loops in pcap and af-packet. --- diff --git a/src/source-af-packet.c b/src/source-af-packet.c index 63d7051646..a14990578a 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -1101,6 +1101,8 @@ TmEcode ReceiveAFPLoop(ThreadVars *tv, void *data, void *slot) SCPerfSyncCountersIfSignalled(tv); } + AFPDumpCounters(ptv); + SCPerfSyncCountersIfSignalled(tv); SCReturnInt(TM_ECODE_OK); } diff --git a/src/source-pcap.c b/src/source-pcap.c index 06f72d18fc..a5143d9118 100644 --- a/src/source-pcap.c +++ b/src/source-pcap.c @@ -346,6 +346,8 @@ TmEcode ReceivePcapLoop(ThreadVars *tv, void *data, void *slot) SCPerfSyncCountersIfSignalled(tv); } + PcapDumpCounters(ptv); + SCPerfSyncCountersIfSignalled(tv); SCReturnInt(TM_ECODE_OK); }