From: Raslan Darawsheh Date: Wed, 14 Sep 2016 11:53:50 +0000 (+0200) Subject: net/mlx5: fix removing VLAN filter X-Git-Tag: spdx-start~5881 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=70d32d3afebfdd827f5f949f588f56d9e7563520;p=dpdk.git 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 --- 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);