common/cnxk: add include for macro definition
[dpdk.git] / lib / ipsec / esp_outb.c
index b7a70fd..5a5429a 100644 (file)
@@ -4,7 +4,6 @@
 
 #include <rte_ipsec.h>
 #include <rte_esp.h>
-#include <rte_ip.h>
 #include <rte_udp.h>
 #include <rte_errno.h>
 #include <rte_cryptodev.h>
@@ -197,7 +196,7 @@ outb_tun_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t sqc,
        /* if UDP encap is enabled update the dgram_len */
        if (sa->type & RTE_IPSEC_SATP_NATT_ENABLE) {
                struct rte_udp_hdr *udph = (struct rte_udp_hdr *)
-                               (ph - sizeof(struct rte_udp_hdr));
+                       (ph + sa->hdr_len - sizeof(struct rte_udp_hdr));
                udph->dgram_len = rte_cpu_to_be_16(mb->pkt_len - sqh_len -
                                sa->hdr_l3_off - sa->hdr_len);
        }
@@ -614,7 +613,7 @@ cpu_outb_trs_pkt_prepare(const struct rte_ipsec_session *ss,
 
 /*
  * process outbound packets for SA with ESN support,
- * for algorithms that require SQN.hibits to be implictly included
+ * for algorithms that require SQN.hibits to be implicitly included
  * into digest computation.
  * In that case we have to move ICV bytes back to their proper place.
  */