examples/ipsec-secgw: fix corner case for SPI value
authorAkhil Goyal <akhil.goyal@nxp.com>
Thu, 11 Jan 2018 11:55:36 +0000 (17:25 +0530)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Sat, 20 Jan 2018 15:10:52 +0000 (16:10 +0100)
commit2a5106af132b6cd740769714cb5096ee3654469e
tree32ea946355ffa0cbfadf199181859fd10d509bf3
parent84d4b5e4ec48bc89814a5c46749775a933c382d6
examples/ipsec-secgw: fix corner case for SPI value

IPSec application is using index 0 of SA table as error,
with current value of IPSEC_SA_MAX_ENTRIES(128) it can
not support SA with spi = 128, as it uses sa_idx = 0
in the SA table.

With this patch, sa_idx = 0 can also be used.

PS: spi = 0 is an invalid SPI and application throws error
for it.

Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application")
Cc: stable@dpdk.org
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
examples/ipsec-secgw/ipsec-secgw.c
examples/ipsec-secgw/sa.c