diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-07-27 20:32:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-27 14:32:31 -0700 |
commit | 7079676d0931e30f4f4949d1580fc87fde4ddc5b (patch) | |
tree | 46d6c13fe92bfff31e17fc34dbd1061fa668f2ba | |
parent | c9588e28123c563a355964c6ee8ca5dd28aebd6a (diff) | |
download | blackbird-op-linux-7079676d0931e30f4f4949d1580fc87fde4ddc5b.tar.gz blackbird-op-linux-7079676d0931e30f4f4949d1580fc87fde4ddc5b.zip |
mlxsw: spectrum_flower: Forbid to offload match on reserved TCP flags bits
Matching on reserved TCP flags bits is only supported using custom
parser. Since the usecase for that is not known now, just forbid to
offload rules that match on these bits.
Reported-by: Alex Kushnarov <alexanderk@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c index c86d582dafbe..0ad1a24abfc6 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c @@ -267,6 +267,12 @@ static int mlxsw_sp_flower_parse_tcp(struct mlxsw_sp *mlxsw_sp, flow_rule_match_tcp(rule, &match); + if (match.mask->flags & htons(0x0E00)) { + NL_SET_ERR_MSG_MOD(f->common.extack, "TCP flags match not supported on reserved bits"); + dev_err(mlxsw_sp->bus_info->dev, "TCP flags match not supported on reserved bits\n"); + return -EINVAL; + } + mlxsw_sp_acl_rulei_keymask_u32(rulei, MLXSW_AFK_ELEMENT_TCP_FLAGS, ntohs(match.key->flags), ntohs(match.mask->flags)); |