net: lan966x: flower: check for unsupported control flags

Use flow_rule_is_supp_control_flags() to reject filters with
unsupported control flags.

In case any unsupported control flags are masked,
flow_rule_is_supp_control_flags() sets a NL extended
error message, and we return -EOPNOTSUPP.

Only compile-tested.

Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Link: https://lore.kernel.org/r/20240424125347.461995-4-ast@fiberby.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Asbjørn Sloth Tønnesen 2024-04-24 12:53:40 +00:00 committed by Jakub Kicinski
parent 12b8e129c4
commit 8c65e27b42

View File

@ -76,6 +76,11 @@ lan966x_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st)
goto bad_frag_out;
}
if (!flow_rule_is_supp_control_flags(FLOW_DIS_IS_FRAGMENT |
FLOW_DIS_FIRST_FRAG,
match.mask->flags, extack))
return -EOPNOTSUPP;
st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL);
return err;