Permalink
Browse files

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

From robwills2 at SourceForge.
  • Loading branch information...
guyharris committed Nov 20, 2011
1 parent 93fea04 commit b107f954e64878ce569cce7c00bd3aa6297ca0c5
Showing with 8 additions and 1 deletion.
  1. +3 −0 ethertype.h
  2. +5 −1 gencode.c
View
@@ -117,3 +117,6 @@
#ifndef ETHERTYPE_LOOPBACK
#define ETHERTYPE_LOOPBACK 0x9000
#endif
+#ifndef ETHERTYPE_8021QINQ
+#define ETHERTYPE_8021QINQ 0x9100
+#endif
View
@@ -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) {

0 comments on commit b107f95

Please sign in to comment.