net/mlx5: fix verification of mark action

A configuration structure for the MARK action must always be specified.

Fixes: ea3bc3b1df ("net/mlx5: support mark flow action")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
This commit is contained in:
Nélio Laranjeiro 2017-01-31 17:02:47 +01:00 committed by Ferruh Yigit
parent 8978c13e54
commit 6194f53bb3

View File

@ -457,7 +457,13 @@ priv_flow_validate(struct priv *priv,
(const struct rte_flow_action_mark *)
actions->conf;
if (mark && (mark->id >= MLX5_FLOW_MARK_MAX)) {
if (!mark) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION,
actions,
"mark must be defined");
return -rte_errno;
} else if (mark->id >= MLX5_FLOW_MARK_MAX) {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ACTION,
actions,