diff options
author | Asbjørn Sloth Tønnesen <ast@fiberby.net> | 2024-04-16 14:43:19 +0000 |
---|---|---|
committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2024-05-08 09:12:09 -0700 |
commit | 174ee5bcfeb7a194b107a8e1a6fa9a1b98de399a (patch) | |
tree | e86eb998bda9ee4db8fc68cb113c6b591b16a27f /drivers/net/ethernet/intel/i40e | |
parent | 252aa6d53931381bd774acd06866ed0fb1976ead (diff) | |
download | lwn-174ee5bcfeb7a194b107a8e1a6fa9a1b98de399a.tar.gz lwn-174ee5bcfeb7a194b107a8e1a6fa9a1b98de399a.zip |
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 <ast@fiberby.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 143e37ae88ef..1f188c052828 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -8671,6 +8671,10 @@ static int i40e_parse_cls_flower(struct i40e_vsi *vsi, 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; } if (addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) { |