From: Victor Julien Date: Tue, 22 Jan 2019 20:28:40 +0000 (+0100) Subject: af-packet: re-enable sync for tpacket v2 X-Git-Tag: suricata-4.1.3~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c99dc5a7bfc3b29f746d28f868d3233b37625770;p=thirdparty%2Fsuricata.git af-packet: re-enable sync for tpacket v2 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. --- diff --git a/src/source-af-packet.c b/src/source-af-packet.c index baaba4f8ae..67a869c8b6 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -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