summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBeilei Xing <beilei.xing@intel.com>2016-07-05 14:15:40 +0800
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-11 17:21:21 +0200
commit8a499c23feaa3174e1c35276481ff1094508bec3 (patch)
treed7f874cf98cda215f2828a2b25f1b6f41e4016c9 /examples
parent54659744c2e6c9cce0ba8777de52ae9896298871 (diff)
downloaddpdk-8a499c23feaa3174e1c35276481ff1094508bec3.zip
dpdk-8a499c23feaa3174e1c35276481ff1094508bec3.tar.gz
dpdk-8a499c23feaa3174e1c35276481ff1094508bec3.tar.xz
examples/tep_term: fix port id check
Coverity reported lots of out-of-bounds in function vxlan_link, these issues should happen when index port_id evaluates to 2, cause size of arrays is 2 in structure. Fix this issue by modifying judgement condition, make sure port_id is less than 2. Coverity issue: 107121, 107122, 107123, 107124, 107125 Fixes: 4abe471ed6fc ("examples/tep_term: implement VXLAN processing") Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/tep_termination/vxlan_setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 37575c2..8f1f15b 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -249,7 +249,7 @@ vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m)
struct rte_eth_tunnel_filter_conf tunnel_filter_conf;
- if (unlikely(portid > VXLAN_N_PORTS)) {
+ if (unlikely(portid >= VXLAN_N_PORTS)) {
RTE_LOG(INFO, VHOST_DATA,
"(%d) WARNING: Not configuring device,"
"as already have %d ports for VXLAN.",