summaryrefslogtreecommitdiff
path: root/net/ethtool/ioctl.c
diff options
context:
space:
mode:
authorVishal Kulkarni <vishal@chelsio.com>2020-08-19 00:25:03 +0530
committerDavid S. Miller <davem@davemloft.net>2020-08-20 16:26:03 -0700
commitd0a84e1f38d9d6ae2dfab0b6c2407d667a265aa5 (patch)
tree80e6f48ad5c1f98ebd073930c05ded715245b687 /net/ethtool/ioctl.c
parentf8c931f3be8dd074bb3e5cae99a8fc8bfdc54dfb (diff)
ethtool: allow flow-type ether without IP protocol field
Set IP protocol mask only when IP protocol field is set. This will allow flow-type ether with vlan rule which don't have protocol field to apply. ethtool -N ens5f4 flow-type ether proto 0x8100 vlan 0x600\ m 0x1FFF action 3 loc 16 Signed-off-by: Vishal Kulkarni <vishal@chelsio.com> Reviewed-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/ioctl.c')
-rw-r--r--net/ethtool/ioctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 441794e0034f..e6f5cf52023c 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -3025,13 +3025,14 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
case TCP_V4_FLOW:
case TCP_V6_FLOW:
match->key.basic.ip_proto = IPPROTO_TCP;
+ match->mask.basic.ip_proto = 0xff;
break;
case UDP_V4_FLOW:
case UDP_V6_FLOW:
match->key.basic.ip_proto = IPPROTO_UDP;
+ match->mask.basic.ip_proto = 0xff;
break;
}
- match->mask.basic.ip_proto = 0xff;
match->dissector.used_keys |= BIT(FLOW_DISSECTOR_KEY_BASIC);
match->dissector.offset[FLOW_DISSECTOR_KEY_BASIC] =