examples/ipsec-secgw: fix out-of-bound check

Coverity issue: 336791
Fixes: 7622291b64 ("examples/ipsec-secgw: allow to specify neighbour MAC address")
Cc: stable@dpdk.org

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
This commit is contained in:
Konstantin Ananyev 2019-03-27 09:33:27 +00:00 committed by Akhil Goyal
parent 728762e37e
commit 7831bcf026

View File

@ -1439,7 +1439,7 @@ print_ethaddr(const char *name, const struct ether_addr *eth_addr)
int
add_dst_ethaddr(uint16_t port, const struct ether_addr *addr)
{
if (port > RTE_DIM(ethaddr_tbl))
if (port >= RTE_DIM(ethaddr_tbl))
return -EINVAL;
ethaddr_tbl[port].dst = ETHADDR_TO_UINT64(addr);