Skip to content

Commit 21e1fe9

Browse files
Asbjørn Sloth Tønnesenanguy11
authored andcommitted
ice: 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: Michal Swiatkowski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent c7b9c49 commit 21e1fe9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/intel/ice/ice_tc_lib.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,6 +1658,10 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi,
16581658
flow_rule_match_control(rule, &match);
16591659

16601660
addr_type = match.key->addr_type;
1661+
1662+
if (flow_rule_has_control_flags(match.mask->flags,
1663+
fltr->extack))
1664+
return -EOPNOTSUPP;
16611665
}
16621666

16631667
if (addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) {

0 commit comments

Comments
 (0)