examples/ipsec-secgw: fix handling IPv6 extension headers
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Thu, 29 Apr 2021 10:47:57 +0000 (11:47 +0100)
committerAkhil Goyal <gakhil@marvell.com>
Wed, 5 May 2021 14:50:21 +0000 (16:50 +0200)
Recent patch to support UDP encapsulation introduced problem with
handling inbound IPv6 packets with header extensions.
This patch aims to fix the issue.

Bugzilla ID: 695
Fixes: 9a1cc8f1ed74 ("examples/ipsec-secgw: support UDP encapsulation")

Reported-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
examples/ipsec-secgw/ipsec-secgw.c

index a9f9b58..f252d34 100644 (file)
@@ -426,7 +426,7 @@ prepare_one_packet(struct rte_mbuf *pkt, struct ipsec_traffic *t)
                        return;
                }
 
-               switch (iph6->proto) {
+               switch (next_proto) {
                case IPPROTO_ESP:
                        t->ipsec.pkts[(t->ipsec.num)++] = pkt;
                        break;