summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>2016-06-09 09:42:42 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-06-21 11:38:51 +0200
commit6723ea61ac6cdcd090c985ee2f0b8cf667ec7596 (patch)
tree76546fa7acf20bf446f3690d57c3128675ed8f0c /examples
parent9fa91cd0f78c79a67d802df9e3b42513feef48af (diff)
downloaddpdk-6723ea61ac6cdcd090c985ee2f0b8cf667ec7596.zip
dpdk-6723ea61ac6cdcd090c985ee2f0b8cf667ec7596.tar.gz
dpdk-6723ea61ac6cdcd090c985ee2f0b8cf667ec7596.tar.xz
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: d299106e8e31 ("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>
Diffstat (limited to 'examples')
-rw-r--r--examples/ipsec-secgw/esp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c
index 0f6b33e..7dce78c 100644
--- a/examples/ipsec-secgw/esp.c
+++ b/examples/ipsec-secgw/esp.c
@@ -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;
}