From: Eric Leblond Date: Tue, 4 Sep 2012 16:43:01 +0000 (+0200) Subject: af-packet: fix emergency mode X-Git-Tag: suricata-1.4beta1~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee6ba09948ddc9128604c0834dc3b400fe6b92e2;p=thirdparty%2Fsuricata.git af-packet: fix emergency mode This patch fixes emergency mode by setting the variable even if we have a non kernel checksum check. It also does a call to AFPDUmpCounters() as it seems to improve thing to do it ASAP. --- diff --git a/src/source-af-packet.c b/src/source-af-packet.c index fd89e39fea..d907fb0335 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -755,9 +755,10 @@ int AFPReadFromRing(AFPThreadVars *ptv) if (h.h2->tp_status & TP_STATUS_CSUMNOTREADY) { p->flags |= PKT_IGNORE_CHECKSUM; } - if (h.h2->tp_status & TP_STATUS_LOSING) { - emergency_flush = 1; - } + } + if (h.h2->tp_status & TP_STATUS_LOSING) { + emergency_flush = 1; + AFPDumpCounters(ptv, 1); } if (TmThreadsSlotProcessPkt(ptv->tv, ptv->slot, p) != TM_ECODE_OK) {