From b9d06d6ab7b874d58154ff12f17eccf20ca871ff Mon Sep 17 00:00:00 2001 From: yogev chaimovich Date: Sun, 28 Feb 2016 11:24:59 +0200 Subject: [PATCH] Added more than one vlan support (with Avi Slavkin) --- src/libnids.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libnids.c b/src/libnids.c index 42b5f96..a92a570 100644 --- a/src/libnids.c +++ b/src/libnids.c @@ -253,6 +253,12 @@ void nids_pcap_handler(u_char * par, struct pcap_pkthdr *hdr, u_char * data) } else if (data[12] == 0x81 && data[13] == 0) { /* Skip 802.1Q VLAN and priority information */ nids_linkoffset = 18; + int vlan_offset = 4; + while(data[12 + vlan_offset] == 0x81 && data[13 + vlan_offset] == 0) + { + nids_linkoffset += 4; + vlan_offset = vlan_offset + 4; + } } else /* non-ip frame */ return;