summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2019-01-10 21:09:09 +0000
committerPablo de Lara <pablo.de.lara.guarch@intel.com>2019-01-10 16:57:22 +0100
commite0dac065f2a232e8060c479a094c7f58cfc93cf9 (patch)
tree82d27e29cf25d0b6cf74967135e05edde6369d79 /examples
parentd92fc70e14f43d13be4204c51ed7f3a671c1bcc4 (diff)
downloaddpdk-next-eventdev-e0dac065f2a232e8060c479a094c7f58cfc93cf9.zip
dpdk-next-eventdev-e0dac065f2a232e8060c479a094c7f58cfc93cf9.tar.gz
dpdk-next-eventdev-e0dac065f2a232e8060c479a094c7f58cfc93cf9.tar.xz
examples/ipsec-secgw: fix inbound SA checking
In the inbound_sa_check() make sure that sa pointer stored inside mbuf private area is not NULL. Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application") Cc: stable@dpdk.org Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/ipsec-secgw/sa.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index f6271bc..839aaca 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -947,10 +947,15 @@ int
inbound_sa_check(struct sa_ctx *sa_ctx, struct rte_mbuf *m, uint32_t sa_idx)
{
struct ipsec_mbuf_metadata *priv;
+ struct ipsec_sa *sa;
priv = get_priv(m);
+ sa = priv->sa;
+ if (sa != NULL)
+ return (sa_ctx->sa[sa_idx].spi == sa->spi);
- return (sa_ctx->sa[sa_idx].spi == priv->sa->spi);
+ RTE_LOG(ERR, IPSEC, "SA not saved in private data\n");
+ return 0;
}
static inline void