From: Qi Zhang Date: Fri, 21 Jul 2017 08:56:37 +0000 (+0800) Subject: net/ixgbe: fix mirror rule index overflow X-Git-Tag: spdx-start~2309 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9b2df1083aab703e73f6d76e8f41afacb463afe9;p=dpdk.git net/ixgbe: fix mirror rule index overflow Mirror rule id should not exceed the boundary defined by IXGBE_MAX_MIRROR_RULES. Fixes: fe3a45fd4104 ("ixgbe: add VMDq support") Cc: stable@dpdk.org Signed-off-by: Qi Zhang --- diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index e436dcafe7..5dc007f000 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -5461,6 +5461,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));