From 4e561d6b206443190b1df5b83ff7e3e4adac823c Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 17 Feb 2014 10:51:12 +0100 Subject: [PATCH] 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. --- src/source-af-packet.c | 2 ++ src/source-pcap.c | 2 ++ 2 files changed, 4 insertions(+) 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); }