Merge tag 'spdx-5.2-rc3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[linux-2.6-block.git] / net / core / ethtool.c
index d97f7320dfdc40287ca4e11a5f5c53c4306e7ba4..6dadeff8d39a2003ab75d25343c2b3549f660055 100644 (file)
@@ -3006,11 +3006,12 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
                const struct ethtool_flow_ext *ext_h_spec = &fs->h_ext;
                const struct ethtool_flow_ext *ext_m_spec = &fs->m_ext;
 
-               if (ext_m_spec->vlan_etype &&
-                   ext_m_spec->vlan_tci) {
+               if (ext_m_spec->vlan_etype) {
                        match->key.vlan.vlan_tpid = ext_h_spec->vlan_etype;
                        match->mask.vlan.vlan_tpid = ext_m_spec->vlan_etype;
+               }
 
+               if (ext_m_spec->vlan_tci) {
                        match->key.vlan.vlan_id =
                                ntohs(ext_h_spec->vlan_tci) & 0x0fff;
                        match->mask.vlan.vlan_id =
@@ -3020,7 +3021,10 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
                                (ntohs(ext_h_spec->vlan_tci) & 0xe000) >> 13;
                        match->mask.vlan.vlan_priority =
                                (ntohs(ext_m_spec->vlan_tci) & 0xe000) >> 13;
+               }
 
+               if (ext_m_spec->vlan_etype ||
+                   ext_m_spec->vlan_tci) {
                        match->dissector.used_keys |=
                                BIT(FLOW_DISSECTOR_KEY_VLAN);
                        match->dissector.offset[FLOW_DISSECTOR_KEY_VLAN] =