Skip to content

Commit 077633a

Browse files
Asbjørn Sloth Tønnesenkuba-moo
authored andcommitted
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>
1 parent af7dfa9 commit 077633a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/mediatek/mtk_ppe_offload.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f,
273273

274274
flow_rule_match_control(rule, &match);
275275
addr_type = match.key->addr_type;
276+
277+
if (flow_rule_has_control_flags(match.mask->flags,
278+
f->common.extack))
279+
return -EOPNOTSUPP;
276280
} else {
277281
return -EOPNOTSUPP;
278282
}

0 commit comments

Comments
 (0)