]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pcap/afpacket: update counters at exit
authorVictor Julien <victor@inliniac.net>
Mon, 17 Feb 2014 09:51:12 +0000 (10:51 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 25 Feb 2014 18:37:44 +0000 (19:37 +0100)
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
src/source-pcap.c

index 63d7051646dceda4f5c4a43f7354656b4373ea04..a14990578af327f8ff835eae5db91f3b4594fc45 100644 (file)
@@ -1101,6 +1101,8 @@ TmEcode ReceiveAFPLoop(ThreadVars *tv, void *data, void *slot)
         SCPerfSyncCountersIfSignalled(tv);
     }
 
+    AFPDumpCounters(ptv);
+    SCPerfSyncCountersIfSignalled(tv);
     SCReturnInt(TM_ECODE_OK);
 }
 
index 06f72d18fcadcb93d0493a7c495efe3b2d1f8c0d..a5143d9118d517a28310516dbfc266aee1af3597 100644 (file)
@@ -346,6 +346,8 @@ TmEcode ReceivePcapLoop(ThreadVars *tv, void *data, void *slot)
         SCPerfSyncCountersIfSignalled(tv);
     }
 
+    PcapDumpCounters(ptv);
+    SCPerfSyncCountersIfSignalled(tv);
     SCReturnInt(TM_ECODE_OK);
 }