summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQi Zhang <qi.z.zhang@intel.com>2017-07-21 16:56:37 +0800
committerYuanhan Liu <yliu@fridaylinux.org>2017-08-29 14:55:37 +0800
commita993a48c81922bce93fcf81f246937d6f4915262 (patch)
tree2147b47207b7037938b4890defaeb32ac39992f9
parent2a7b606ebc7d5455b98d6a674c1acc26020c86db (diff)
downloaddpdk-stable-a993a48c81922bce93fcf81f246937d6f4915262.zip
dpdk-stable-a993a48c81922bce93fcf81f246937d6f4915262.tar.gz
dpdk-stable-a993a48c81922bce93fcf81f246937d6f4915262.tar.xz
net/ixgbe: fix mirror rule index overflow
[ upstream commit 9b2df1083aab703e73f6d76e8f41afacb463afe9 ] Mirror rule id should not exceed the boundary defined by IXGBE_MAX_MIRROR_RULES. Fixes: fe3a45fd4104 ("ixgbe: add VMDq support") Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
-rw-r--r--drivers/net/ixgbe/ixgbe_ethdev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 0a142ee..626c5ee 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -5323,6 +5323,9 @@ ixgbe_mirror_rule_reset(struct rte_eth_dev *dev, uint8_t rule_id)
if (ixgbe_vt_check(hw) < 0)
return -ENOTSUP;
+ if (rule_id >= IXGBE_MAX_MIRROR_RULES)
+ return -EINVAL;
+
memset(&mr_info->mr_conf[rule_id], 0,
sizeof(struct rte_eth_mirror_conf));