From 5f2831d60ff616342d789b5e55830332ecb3b20c Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 29 Oct 2018 09:37:11 +0100 Subject: [PATCH] pfring: support checking/disabling offloading --- src/runmode-pfring.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/runmode-pfring.c b/src/runmode-pfring.c index 9c107b74ee..16712a689c 100644 --- a/src/runmode-pfring.c +++ b/src/runmode-pfring.c @@ -29,6 +29,7 @@ #include "util-affinity.h" #include "util-runmodes.h" #include "util-device.h" +#include "util-ioctl.h" #ifdef HAVE_PFRING #include @@ -372,6 +373,14 @@ static void *ParsePfringConfig(const char *iface) } } + if (LiveGetOffload() == 0) { + if (GetIfaceOffloading(iface, 0, 1) == 1) { + SCLogWarning(SC_ERR_NIC_OFFLOADING, + "Using PF_RING with offloading activated leads to capture problems"); + } + } else { + DisableIfaceOffloading(LiveGetDevice(iface), 0, 1); + } return pfconf; }