[dpdk-dev] [PATCH 1/9] examples/ipsec-secgw: fix esp padding check
Sergio Gonzalez Monroy
sergio.gonzalez.monroy at intel.com
Fri May 6 18:31:34 CEST 2016
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 at intel.com>
---
examples/ipsec-secgw/esp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c
index 1927380..3e98253 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) {
IPSEC_LOG(ERR, IPSEC_ESP, "invalid pad_len field\n");
return -EINVAL;
}
--
2.5.5
More information about the dev
mailing list