From: Eric Leblond Date: Mon, 3 Sep 2012 16:38:45 +0000 (+0200) Subject: af-packet: ring mode is not optionnal in AFPReadFromRing X-Git-Tag: suricata-1.4beta1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f2b34068cd04422ef968ab0d149cb0f704da875;p=thirdparty%2Fsuricata.git af-packet: ring mode is not optionnal in AFPReadFromRing --- diff --git a/src/source-af-packet.c b/src/source-af-packet.c index 8ceac4a3d7..296ebc2e7e 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -650,16 +650,14 @@ int AFPReadFromRing(AFPThreadVars *ptv) SCReturnInt(AFP_FAILURE); } - if (ptv->flags & AFP_RING_MODE) { - p->afp_v.relptr = h.raw; - p->ReleaseData = AFPReleaseDataFromRing; + p->afp_v.relptr = h.raw; + p->ReleaseData = AFPReleaseDataFromRing; - p->afp_v.copy_mode = ptv->copy_mode; - if (p->afp_v.copy_mode != AFP_COPY_MODE_NONE) { - p->afp_v.peer = ptv->mpeer->peer; - } else { - p->afp_v.peer = NULL; - } + p->afp_v.copy_mode = ptv->copy_mode; + if (p->afp_v.copy_mode != AFP_COPY_MODE_NONE) { + p->afp_v.peer = ptv->mpeer->peer; + } else { + p->afp_v.peer = NULL; } from = (void *)h.raw + TPACKET_ALIGN(ptv->tp_hdrlen); @@ -686,17 +684,15 @@ int AFPReadFromRing(AFPThreadVars *ptv) TmqhOutputPacketpool(ptv->tv, p); SCReturnInt(AFP_FAILURE); } else { - if (ptv->flags & AFP_RING_MODE) { - p->afp_v.relptr = h.raw; - - p->afp_v.copy_mode = ptv->copy_mode; - if (p->afp_v.copy_mode != AFP_COPY_MODE_NONE) { - p->afp_v.peer = ptv->mpeer->peer; - } else { - p->afp_v.peer = NULL; - } - p->ReleaseData = AFPReleaseDataFromRing; + p->afp_v.relptr = h.raw; + + p->afp_v.copy_mode = ptv->copy_mode; + if (p->afp_v.copy_mode != AFP_COPY_MODE_NONE) { + p->afp_v.peer = ptv->mpeer->peer; + } else { + p->afp_v.peer = NULL; } + p->ReleaseData = AFPReleaseDataFromRing; } } else { if (PacketCopyData(p, (unsigned char*)h.raw + h.h2->tp_mac, h.h2->tp_snaplen) == -1) {