In case of VLAN packet we must substract the VLAN header length from
the packet length not the pointer to it.
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/packet.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/packet.c b/src/packet.c
index 290e2ba..0a1f0ff 100644
--- a/src/packet.c
+++ b/src/packet.c
@@ -56,7 +56,7 @@ static void adjustpacket(char *tpacket, struct sockaddr_ll *fromaddr,
if (fromaddr->sll_protocol == ETH_P_8021Q) {
/* 0x8100 802.1Q VLAN Extended Header */
*packet = tpacket + VLAN_ETH_HLEN;
- readlen -= VLAN_ETH_HLEN;
+ *readlen -= VLAN_ETH_HLEN;
break;
}
--
1.7.8.4