]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
af-packet: add warning message if LRO or GRO are set
authorEric Leblond <eric@regit.org>
Tue, 19 Nov 2013 15:10:38 +0000 (16:10 +0100)
committerEric Leblond <eric@regit.org>
Mon, 25 Nov 2013 14:08:54 +0000 (15:08 +0100)
This patch query the network interface to detect if LRO or GRO are
used in mmap TPACKET_V2 mode.

src/source-af-packet.c

index d6b9306ba6e55cec6c6b1b8d10c06525775563f7..24837b3f38fc32cdefe5fa77b75bc8eaf71a45c0 100644 (file)
@@ -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--) {