Skip to content

Commit c7b9c49

Browse files
Asbjørn Sloth Tønnesenanguy11
authored andcommitted
iavf: 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 174ee5b commit c7b9c49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3757,6 +3757,10 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
37573757

37583758
flow_rule_match_control(rule, &match);
37593759
addr_type = match.key->addr_type;
3760+
3761+
if (flow_rule_has_control_flags(match.mask->flags,
3762+
f->common.extack))
3763+
return -EOPNOTSUPP;
37603764
}
37613765

37623766
if (addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) {

0 commit comments

Comments
 (0)