examples/ipsec-secgw: fix esp padding check

Current code fails to correctly check padding sequence for inbound
packets.
Padding sequence starts on 1 but it checks for 0.

Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit is contained in:
Sergio Gonzalez Monroy 2016-06-09 09:42:42 +01:00 committed by Thomas Monjalon
parent 9fa91cd0f7
commit 6723ea61ac

View File

@ -139,7 +139,7 @@ esp4_tunnel_inbound_post_crypto(struct rte_mbuf *m, struct ipsec_sa *sa,
padding = pad_len - *pad_len;
for (i = 0; i < *pad_len; i++) {
if (padding[i] != i) {
if (padding[i] != i + 1) {
RTE_LOG(ERR, IPSEC_ESP, "invalid pad_len field\n");
return -EINVAL;
}