New upstream version 17.11.1
[deb_dpdk.git] / examples / ipsec-secgw / ipsec.c
index 70ed227..c850c7b 100644 (file)
@@ -187,7 +187,7 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa)
                        sa->pattern[2].type = RTE_FLOW_ITEM_TYPE_ESP;
                        sa->pattern[2].spec = &sa->esp_spec;
                        sa->pattern[2].mask = &rte_flow_item_esp_mask;
-                       sa->esp_spec.hdr.spi = sa->spi;
+                       sa->esp_spec.hdr.spi = rte_cpu_to_be_32(sa->spi);
 
                        sa->pattern[3].type = RTE_FLOW_ITEM_TYPE_END;
 
@@ -198,6 +198,8 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa)
 
                        sa->attr.egress = (sa->direction ==
                                        RTE_SECURITY_IPSEC_SA_DIR_EGRESS);
+                       sa->attr.ingress = (sa->direction ==
+                                       RTE_SECURITY_IPSEC_SA_DIR_INGRESS);
                        sa->flow = rte_flow_create(sa->portid,
                                &sa->attr, sa->pattern, sa->action, &err);
                        if (sa->flow == NULL) {