From: Victor Julien Date: Tue, 31 May 2016 12:22:00 +0000 (+0200) Subject: pfring: cleanup X-Git-Tag: suricata-3.1RC1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=661d7c1d092df6fef31185ddfefe2d0f71080259;p=thirdparty%2Fsuricata.git pfring: cleanup --- diff --git a/src/source-pfring.c b/src/source-pfring.c index 5cee51344a..4ce3c81e34 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -344,22 +344,20 @@ TmEcode ReceivePfringLoop(ThreadVars *tv, void *data, void *slot) pkt_buffer = GET_PKT_DIRECT_DATA(p); } - /* Depending on what compile time options are used for pfring we either return 0 or -1 on error and always 1 for success */ int r = pfring_recv(ptv->pd, &pkt_buffer, buffer_size, &hdr, LIBPFRING_WAIT_FOR_INCOMING); - - /* Check for Zero-copy mode */ - if (ptv->flags & PFRING_FLAGS_ZERO_COPY) { - PacketSetData(p, pkt_buffer, hdr.caplen); - } - if (likely(r == 1)) { /* profiling started before blocking pfring_recv call, so * reset it here */ PACKET_PROFILING_RESTART(p); + /* Check for Zero-copy mode */ + if (ptv->flags & PFRING_FLAGS_ZERO_COPY) { + PacketSetData(p, pkt_buffer, hdr.caplen); + } + //printf("RecievePfring src %" PRIu32 " sport %" PRIu32 " dst %" PRIu32 " dstport %" PRIu32 "\n", // hdr.parsed_pkt.ipv4_src,hdr.parsed_pkt.l4_src_port, hdr.parsed_pkt.ipv4_dst,hdr.parsed_pkt.l4_dst_port);