Commit d9a1249e authored by Asbjørn Sloth Tønnesen's avatar Asbjørn Sloth Tønnesen Committed by David S. Miller

net: dsa: microchip: ksz9477: flower: validate control flags

Add check for unsupported control flags.

Only compile-tested, no access to HW.
Signed-off-by: default avatarAsbjørn Sloth Tønnesen <ast@fiberby.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f8a5ea8c
...@@ -124,6 +124,9 @@ static int ksz9477_flower_parse_key(struct ksz_device *dev, int port, ...@@ -124,6 +124,9 @@ static int ksz9477_flower_parse_key(struct ksz_device *dev, int port,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
if (flow_rule_match_has_control_flags(rule, extack))
return -EOPNOTSUPP;
if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC) || if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC) ||
flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) {
ret = ksz9477_flower_parse_key_l2(dev, port, extack, rule, ret = ksz9477_flower_parse_key_l2(dev, port, extack, rule,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment