net/mlx5: fix flow item validation
authorNélio Laranjeiro <nelio.laranjeiro@6wind.com>
Tue, 23 Jan 2018 08:05:09 +0000 (09:05 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 29 Jan 2018 09:04:28 +0000 (10:04 +0100)
Two masks were compared instead of verifying the spec was included in the
supported mask.

Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
drivers/net/mlx5/mlx5_flow.c

index 6b3198a..444b7df 100644 (file)
@@ -529,7 +529,7 @@ mlx5_flow_item_validate(const struct rte_flow_item *item,
        }
        if (item->mask) {
                unsigned int i;
-               const uint8_t *spec = item->mask;
+               const uint8_t *spec = item->spec;
 
                for (i = 0; i < size; ++i)
                        if ((spec[i] | mask[i]) != mask[i])