From 4defc5acc21e92b53d6993e6133871e3636a9193 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 31 May 2016 15:55:31 +0200 Subject: [PATCH] util-ioctcl: increase header size Headers can contain VLAN or Qing so we need to increase the value returned by GetIfaceMaxHWHeaderLength. --- src/util-ioctl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/util-ioctl.c b/src/util-ioctl.c index e0b5ef824b..9371846036 100644 --- a/src/util-ioctl.c +++ b/src/util-ioctl.c @@ -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; } /** -- 2.47.2