]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
af-packet: leave reading loop at each turn
authorEric Leblond <eric@regit.org>
Mon, 25 Feb 2013 13:57:55 +0000 (14:57 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 1 Mar 2013 17:45:37 +0000 (18:45 +0100)
The idea of this patch is to be sure to leave the ring reading loop
enough to be able to sync counters. This should fix #706.

src/source-af-packet.c

index 1355c82038cc07dd13d64fc74b37715486980e2c..144ceb64c3d8e766c994d6b44d10a4000813ffeb 100644 (file)
@@ -838,6 +838,8 @@ int AFPReadFromRing(AFPThreadVars *ptv)
 next_frame:
         if (++ptv->frame_offset >= ptv->req.tp_frame_nr) {
             ptv->frame_offset = 0;
+            /* Get out of loop to be sure we will reach maintenance tasks */
+            SCReturnInt(AFP_READ_OK);
         }
     }