Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

When checking for VLAN tags, check for QinQ tags as well.

From robwills2 at SourceForge.
  • Loading branch information...
commit b107f954e64878ce569cce7c00bd3aa6297ca0c5 1 parent 93fea04
@guyharris guyharris authored
Showing with 8 additions and 1 deletion.
  1. +3 −0  ethertype.h
  2. +5 −1 gencode.c
View
3  ethertype.h
@@ -117,3 +117,6 @@
#ifndef ETHERTYPE_LOOPBACK
#define ETHERTYPE_LOOPBACK 0x9000
#endif
+#ifndef ETHERTYPE_8021QINQ
+#define ETHERTYPE_8021QINQ 0x9100
+#endif
View
6 gencode.c
@@ -8108,9 +8108,13 @@ gen_vlan(vlan_num)
case DLT_EN10MB:
case DLT_NETANALYZER:
case DLT_NETANALYZER_TRANSPARENT:
- /* check for VLAN */
+ /* check for VLAN, including QinQ */
b0 = gen_cmp(OR_LINK, off_linktype, BPF_H,
(bpf_int32)ETHERTYPE_8021Q);
+ b1 = gen_cmp(OR_LINK, off_linktype, BPF_H,
+ (bpf_int32)ETHERTYPE_8021QINQ);
+ gen_or(b0,b1);
+ b0 = b1;
/* If a specific VLAN is requested, check VLAN id */
if (vlan_num >= 0) {
Please sign in to comment.
Something went wrong with that request. Please try again.