From 2855ee5aefbff1ed52231068fe1280e5c982bec8 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 19 Nov 2013 16:10:38 +0100 Subject: [PATCH] af-packet: add warning message if LRO or GRO are set This patch query the network interface to detect if LRO or GRO are used in mmap TPACKET_V2 mode. --- src/source-af-packet.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/source-af-packet.c b/src/source-af-packet.c index d6b9306ba6..24837b3f38 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -1217,8 +1217,6 @@ static int AFPCreateSocket(AFPThreadVars *ptv, char *devname, int verbose) goto socket_err; } - - if (ptv->promisc != 0) { /* Force promiscuous mode */ memset(&sock_params, 0, sizeof(sock_params)); @@ -1315,6 +1313,11 @@ static int AFPCreateSocket(AFPThreadVars *ptv, char *devname, int verbose) goto socket_err; } + if (GetIfaceOffloading(devname) == 1) { + SCLogWarning(SC_ERR_AFP_CREATE, + "Using mmap mode with GRO or LRO activated can lead to capture problems"); + } + /* Allocate RX ring */ #define DEFAULT_ORDER 3 for (order = DEFAULT_ORDER; order >= 0; order--) {