diff options
author | Asbjørn Sloth Tønnesen <ast@fiberby.net> | 2024-04-18 18:18:15 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-04-23 02:42:34 +0200 |
commit | 077633afe07f4df8297e93332a4c07934c1f7b64 (patch) | |
tree | 72cedfe08d3a96d86200b89a5d2692d328a387e3 /drivers/net/ethernet/mediatek | |
parent | dpaa2-switch: flower: validate control flags (diff) | |
download | linux-077633afe07f4df8297e93332a4c07934c1f7b64.tar.xz linux-077633afe07f4df8297e93332a4c07934c1f7b64.zip |
net: ethernet: mtk_eth_soc: flower: validate control flags
This driver currently doesn't support any control flags.
Use flow_rule_has_control_flags() to check for control flags,
such as can be set through `tc flower ... ip_flags frag`.
In case any control flags are masked, flow_rule_has_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: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240418161821.189263-1-ast@fiberby.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/mediatek')
-rw-r--r-- | drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c index fbb5e9d5af13..aa262e6f4b85 100644 --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c @@ -273,6 +273,10 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f, flow_rule_match_control(rule, &match); addr_type = match.key->addr_type; + + if (flow_rule_has_control_flags(match.mask->flags, + f->common.extack)) + return -EOPNOTSUPP; } else { return -EOPNOTSUPP; } |