From 56bf931959e0605a4754f867e7b23476fef51891 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Fri, 25 Mar 2011 20:44:27 +0100 Subject: [PATCH] pfring: use macro for direct access Existing code was correct but it was using a direct access to pkt field. This patch uses the newly defined macro to have a clean access on the pkt data. --- src/source-pfring.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/source-pfring.c b/src/source-pfring.c index 016cfa8d5c..3cc757c1c5 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -219,7 +219,11 @@ TmEcode ReceivePfring(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, Pa } /* 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, (char *)p->pkt , (u_int)(default_packet_size - 1), &hdr, LIBPFRING_WAIT_FOR_INCOMING); + + int r = pfring_recv(ptv->pd, (char *)GET_PKT_DIRECT_DATA(p), + (u_int)GET_PKT_DIRECT_MAX_SIZE(p), + &hdr, + LIBPFRING_WAIT_FOR_INCOMING); if (r == 1) { //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);