]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
af-packet: re-enable sync for tpacket v2
authorVictor Julien <victor@inliniac.net>
Tue, 22 Jan 2019 20:28:40 +0000 (21:28 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 23 Jan 2019 09:25:47 +0000 (10:25 +0100)
Synchronize start was disabled for v2 when v3 was introduced, without
a reason being given.

Re-enable as v2 will otherwise also start reading packets before the
other threads are set up. This will lead to hashing issues.

Part of bug #2788.

src/source-af-packet.c

index baaba4f8ae096c1d13d8d0f0f42ad68c686e4156..67a869c8b61c4c6feb2b6a9fddcfb04e99481eed 100644 (file)
@@ -1507,9 +1507,7 @@ TmEcode ReceiveAFPLoop(ThreadVars *tv, void *data, void *slot)
     }
     if (ptv->afp_state == AFP_STATE_UP) {
         SCLogDebug("Thread %s using socket %d", tv->name, ptv->socket);
-        if ((ptv->flags & AFP_TPACKET_V3) != 0) {
-            AFPSynchronizeStart(ptv, &discarded_pkts);
-        }
+        AFPSynchronizeStart(ptv, &discarded_pkts);
         /* let's reset counter as we will start the capture at the
          * next function call */
 #ifdef PACKET_STATISTICS