Skip to content

Commit 174ee5b

Browse files
Asbjørn Sloth Tønnesenanguy11
authored andcommitted
i40e: 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 <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 252aa6d commit 174ee5b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8671,6 +8671,10 @@ static int i40e_parse_cls_flower(struct i40e_vsi *vsi,
86718671

86728672
flow_rule_match_control(rule, &match);
86738673
addr_type = match.key->addr_type;
8674+
8675+
if (flow_rule_has_control_flags(match.mask->flags,
8676+
f->common.extack))
8677+
return -EOPNOTSUPP;
86748678
}
86758679

86768680
if (addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) {

0 commit comments

Comments
 (0)