[dpdk-stable] patch 'examples/ipsec-secgw: fix IPv6 payload length' has been queued to LTS release 16.11.4
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Nov 2 13:02:36 CET 2017
Hi,
FYI, your patch has been queued to LTS release 16.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/04/17. So please
shout if anyone has objections.
Thanks.
Kind regards,
Luca Boccassi
---
>From 8978c2082e5cd1719af9695240fe38a5f62de410 Mon Sep 17 00:00:00 2001
From: Tomasz Duszynski <tdu at semihalf.com>
Date: Fri, 13 Oct 2017 10:04:36 +0200
Subject: [PATCH] examples/ipsec-secgw: fix IPv6 payload length
[ upstream commit b43a81319b2411bbdb96bd349cd3cdfd66714777 ]
IPv6 payload length header field should contain only the number of bytes
following the IPv6 header and not the entire packet size.
Fixes: f159e70b0922 ("examples/ipsec-secgw: support transport mode")
Fixes: 906257e965b7 ("examples/ipsec-secgw: support IPv6")
Signed-off-by: Tomasz Duszynski <tdu at semihalf.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy at intel.com>
---
examples/ipsec-secgw/esp.c | 6 ++++--
examples/ipsec-secgw/ipip.h | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c
index c5f30f7d9..1a2f07edb 100644
--- a/examples/ipsec-secgw/esp.c
+++ b/examples/ipsec-secgw/esp.c
@@ -199,7 +199,8 @@ esp_inbound_post(struct rte_mbuf *m, struct ipsec_sa *sa,
/* XXX No option headers supported */
memmove(ip6, ip, sizeof(struct ip6_hdr));
ip6->ip6_nxt = *nexthdr;
- ip6->ip6_plen = htons(rte_pktmbuf_data_len(m));
+ ip6->ip6_plen = htons(rte_pktmbuf_data_len(m) -
+ sizeof(struct ip6_hdr));
}
} else
ipip_inbound(m, sizeof(struct esp_hdr) + sa->iv_len);
@@ -301,7 +302,8 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa,
} else {
ip6 = (struct ip6_hdr *)new_ip;
ip6->ip6_nxt = IPPROTO_ESP;
- ip6->ip6_plen = htons(rte_pktmbuf_data_len(m));
+ ip6->ip6_plen = htons(rte_pktmbuf_data_len(m) -
+ sizeof(struct ip6_hdr));
}
}
diff --git a/examples/ipsec-secgw/ipip.h b/examples/ipsec-secgw/ipip.h
index ff1dccdb8..93393d527 100644
--- a/examples/ipsec-secgw/ipip.h
+++ b/examples/ipsec-secgw/ipip.h
@@ -72,7 +72,8 @@ ipip_outbound(struct rte_mbuf *m, uint32_t offset, uint32_t is_ipv6,
/* Per RFC4301 5.1.2.1 */
outip6->ip6_flow = htonl(IP6_VERSION << 28 | ds_ecn << 20);
- outip6->ip6_plen = htons(rte_pktmbuf_data_len(m));
+ outip6->ip6_plen = htons(rte_pktmbuf_data_len(m) -
+ sizeof(struct ip6_hdr));
outip6->ip6_nxt = IPPROTO_ESP;
outip6->ip6_hops = IPDEFTTL;
--
2.11.0
More information about the stable
mailing list