]> The Tcpdump Group git mirrors - libpcap/commitdiff
Check offloaded vlans are from the outermost part of the packet.
authorJesse Gross <[email protected]>
Wed, 11 Feb 2015 01:00:45 +0000 (17:00 -0800)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 17 Feb 2015 14:40:00 +0000 (15:40 +0100)
VLAN acceleration doesn't apply to any tags that are inside of
any type of encapsulation.

gencode.c

index 277015e39ff8cd578875137b70e5f6c86d2de9f9..af0f3017a7e31f6943a419c24e574f8876175db3 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -7955,7 +7955,11 @@ gen_vlan(vlan_num)
        case DLT_NETANALYZER:
        case DLT_NETANALYZER_TRANSPARENT:
 #if defined(SKF_AD_VLAN_TAG) && defined(SKF_AD_VLAN_TAG_PRESENT)
-               if (vlan_stack_depth == 0) {
+               /* Verify that this is the outer part of the packet and
+                * not encapsulated somehow. */
+               if (vlan_stack_depth == 0 && !off_linkhdr.is_variable &&
+                   off_linkhdr.constant_part ==
+                   off_outermostlinkhdr.constant_part) {
                        /*
                         * Do we need special VLAN handling?
                         */