]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-ioctcl: increase header size 2129/head
authorEric Leblond <eric@regit.org>
Tue, 31 May 2016 13:55:31 +0000 (15:55 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 1 Jun 2016 08:50:22 +0000 (10:50 +0200)
Headers can contain VLAN or Qing so we need to increase the value
returned by GetIfaceMaxHWHeaderLength.

src/util-ioctl.c

index e0b5ef824b2d52a1fc246ab703b2bf88869e2c21..93718460361cf88b4b85c8bb7fd61be8976c172f 100644 (file)
@@ -61,13 +61,16 @@ int GetIfaceMaxHWHeaderLength(const char *pcap_dev)
             ||
             (!strcmp("tap", pcap_dev))
             ||
-            (!strcmp("lo", pcap_dev)))
-        return ETHERNET_HEADER_LEN;
+            (!strcmp("lo", pcap_dev))) {
+        /* Add possible VLAN tag or Qing headers */
+        return 8 + ETHERNET_HEADER_LEN;
+    }
 
     if (!strcmp("ppp", pcap_dev))
         return SLL_HEADER_LEN;
-    /* SLL_HEADER_LEN is the biggest one */
-    return SLL_HEADER_LEN;
+    /* SLL_HEADER_LEN is the biggest one and
+       add possible VLAN tag and Qing headers */
+    return 8 + SLL_HEADER_LEN;
 }
 
 /**