]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
netmap: optionally disable offloading
authorVictor Julien <victor@inliniac.net>
Mon, 20 Jun 2016 18:17:30 +0000 (20:17 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 22 Sep 2016 11:36:27 +0000 (13:36 +0200)
src/source-netmap.c

index ec38c1f7a618de541c27ecc773060720d7f126b0..48c16fe55d061699603120a83338cf7c835ff191 100644 (file)
@@ -294,7 +294,11 @@ static int NetmapOpen(char *ifname, int promisc, NetmapDevice **pdevice, int ver
     }
 
     /* netmap needs all offloading to be disabled */
-    (void)GetIfaceOffloading(ifname, 1, 1);
+    if (LiveGetOffload() == 0) {
+        (void)GetIfaceOffloading(ifname, 1, 1);
+    } else {
+        DisableIfaceOffloading(ifname, 1, 1);
+    }
 
     /* not found, create new record */
     pdev = SCMalloc(sizeof(*pdev));