X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fipsec-secgw%2Fsa.c;h=7262ccee83db1071a21fd9ce7435ebe6820efc60;hb=5908e7e837a62fe62c48094d8c2e947242f8fac3;hp=8043ed54accc3f26062214f7497dc3ab765849e1;hpb=a7c528e5d71ff3f569898d268f9de129fdfc152b;p=dpdk.git diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index 8043ed54ac..7262ccee83 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -951,7 +951,7 @@ get_spi_proto(uint32_t spi, enum rte_security_ipsec_sa_direction dir) if (rc6 >= 0) { RTE_LOG(ERR, IPSEC, "%s: SPI %u used simultaeously by " - "IPv4(%d) and IPv6 (%d) SP rules\n", + "RTE_IPV4(%d) and IPv6 (%d) SP rules\n", __func__, spi, rc4, rc6); return -EINVAL; } else @@ -1040,7 +1040,7 @@ ipsec_sa_init(struct ipsec_sa *lsa, struct rte_ipsec_sa *sa, uint32_t sa_size) struct rte_ipsec_sa_prm prm; struct rte_ipv4_hdr v4 = { .version_ihl = IPVERSION << 4 | - sizeof(v4) / IPV4_IHL_MULTIPLIER, + sizeof(v4) / RTE_IPV4_IHL_MULTIPLIER, .time_to_live = IPDEFTTL, .next_proto_id = IPPROTO_ESP, .src_addr = lsa->src.ip.ip4, @@ -1228,10 +1228,7 @@ single_inbound_lookup(struct ipsec_sa *sadb, struct rte_mbuf *pkt, *sa_ret = NULL; ip = rte_pktmbuf_mtod(pkt, struct ip *); - if (ip->ip_v == IPVERSION) - esp = (struct rte_esp_hdr *)(ip + 1); - else - esp = (struct rte_esp_hdr *)(((struct ip6_hdr *)ip) + 1); + esp = rte_pktmbuf_mtod_offset(pkt, struct rte_esp_hdr *, pkt->l3_len); if (esp->spi == INVALID_SPI) return;