From 70d32d3afebfdd827f5f949f588f56d9e7563520 Mon Sep 17 00:00:00 2001 From: Raslan Darawsheh Date: Wed, 14 Sep 2016 13:53:50 +0200 Subject: [PATCH] net/mlx5: fix removing VLAN filter memmove was moving bytes as the number of elements next to i, while it should move the number of elements multiplied by the size of each element. Fixes: e9086978 ("mlx5: support VLAN filtering") Signed-off-by: Raslan Darawsheh --- drivers/net/mlx5/mlx5_vlan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c index 4719e697f6..fb730e52b9 100644 --- a/drivers/net/mlx5/mlx5_vlan.c +++ b/drivers/net/mlx5/mlx5_vlan.c @@ -87,7 +87,8 @@ vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) --priv->vlan_filter_n; memmove(&priv->vlan_filter[i], &priv->vlan_filter[i + 1], - priv->vlan_filter_n - i); + sizeof(priv->vlan_filter[i]) * + (priv->vlan_filter_n - i)); priv->vlan_filter[priv->vlan_filter_n] = 0; } else { assert(i == priv->vlan_filter_n); -- 2.20.1