]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
af-packet: fix emergency mode
authorEric Leblond <eric@regit.org>
Tue, 4 Sep 2012 16:43:01 +0000 (18:43 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 6 Sep 2012 08:24:05 +0000 (10:24 +0200)
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.

src/source-af-packet.c

index fd89e39fea043019fd840fcfceefc8a86404fee5..d907fb03357f2d70743c93cd96ffd13bc85d304c 100644 (file)
@@ -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) {