diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 2a1f513a2dc8..9671d79dd986 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -1201,8 +1201,8 @@ bool __skb_flow_dissect(const struct net *net, nhoff += sizeof(*vlan); } - if (dissector_uses_key(flow_dissector, - FLOW_DISSECTOR_KEY_NUM_OF_VLANS)) { + if (dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_NUM_OF_VLANS) && + !(key_control->flags & FLOW_DIS_ENCAPSULATION)) { struct flow_dissector_key_num_of_vlans *key_nvs; key_nvs = skb_flow_dissector_target(flow_dissector,