]> git.droids-corp.org - dpdk.git/blobdiff - examples/ipsec-secgw/ipsec-secgw.c
examples/ipsec-secgw: check SP only when setup
[dpdk.git] / examples / ipsec-secgw / ipsec-secgw.c
index 8b55534f37a717bb42656d4a91b0f3f261b87dc8..9eee96fbcf468fcedef80c8cfcbcb763ea09f432 100644 (file)
@@ -388,7 +388,7 @@ inbound_sp_sa(struct sp_ctx *sp, struct sa_ctx *sa, struct traffic_type *ip,
        struct rte_mbuf *m;
        uint32_t i, j, res, sa_idx;
 
-       if (ip->num == 0)
+       if (ip->num == 0 || sp == NULL)
                return;
 
        rte_acl_classify((struct rte_acl_ctx *)sp, ip->data, ip->res,
@@ -463,7 +463,7 @@ outbound_sp(struct sp_ctx *sp, struct traffic_type *ip,
        struct rte_mbuf *m;
        uint32_t i, j, sa_idx;
 
-       if (ip->num == 0)
+       if (ip->num == 0 || sp == NULL)
                return;
 
        rte_acl_classify((struct rte_acl_ctx *)sp, ip->data, ip->res,