]> git.droids-corp.org - dpdk.git/blobdiff - examples/ipsec-secgw/ipsec-secgw.c
examples/ipsec-secgw: fix out-of-bound check
[dpdk.git] / examples / ipsec-secgw / ipsec-secgw.c
index b253eea2bfe94ecc19716588815614bebdadc432..ffbd00b0806d85b4839dd297c8348090cfcb0920 100644 (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);