lkml.org 
[lkml]   [2024]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH net-next 4/6] net: prestera: flower: validate control flags
Date
Add check for unsupported control flags.

Only compile-tested, no access to HW.

Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
---
drivers/net/ethernet/marvell/prestera/prestera_flower.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/marvell/prestera/prestera_flower.c b/drivers/net/ethernet/marvell/prestera/prestera_flower.c
index 8b9455d8a4f7a..075aed847913d 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_flower.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_flower.c
@@ -229,6 +229,10 @@ static int prestera_flower_parse(struct prestera_flow_block *block,

flow_rule_match_control(f_rule, &match);
addr_type = match.key->addr_type;
+
+ if (!flow_rule_no_control_flags(match.mask->flags,
+ f->common.extack))
+ return -EOPNOTSUPP;
}

if (flow_rule_match_key(f_rule, FLOW_DISSECTOR_KEY_BASIC)) {
--
2.43.0

\
 
 \ /
  Last update: 2024-05-27 16:28    [W:0.095 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site