]> 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>
Sat, 16 Feb 2019 13:58:18 +0000 (14:58 +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 b4a4298a43ed502a9acdd5fa4dc181006b1939c1..59cb442b81cd19b5eb66bfee54fee77427f8012c 100644 (file)
@@ -1437,9 +1437,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