net: ethernet: mtk_eth_soc: flower: validate control flags
Subsystems (4)
PATCH 1/1 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.
--- drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/mediatek/mtk_ppe_offload.c +4 -0
@@ -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 ; }
Signature · 1 line
2.43.0
Quoted 11 lines · Asbjørn Sloth Tønnesen
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 throughtc 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 <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Thu, 18 Apr 2024 16:18:15 +0000 you wrote:
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 throughtc 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.[...]
Here is the summary with links:
- [net-next] net: ethernet: mtk_eth_soc: flower: validate control flags
https://git.kernel.org/netdev/net-next/c/077633afe07f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html