From: Victor Julien Date: Mon, 29 Oct 2018 08:37:11 +0000 (+0100) Subject: pfring: support checking/disabling offloading X-Git-Tag: suricata-4.1.0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f2831d60ff616342d789b5e55830332ecb3b20c;p=thirdparty%2Fsuricata.git pfring: support checking/disabling offloading --- 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; }