diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2018-08-29 18:59:44 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2018-08-29 19:00:12 +0100 |
commit | 8e6d9d118f6105a3627b64a7949e1fb0b145879e (patch) | |
tree | 6494692bc19c7dd9cae2b16cf6e0ed7e90aa1da8 /examples/ipsec-secgw | |
parent | 43192222b329b3c984687235b0081c7fbfe484ba (diff) |
New upstream version 16.11.8upstream/16.11.8
Change-Id: I3d0a7da377a86fe41f3516c5a3c458746abc33fb
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'examples/ipsec-secgw')
-rw-r--r-- | examples/ipsec-secgw/ipsec-secgw.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 3c1ea16d..05c76459 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -304,6 +304,7 @@ prepare_tx_pkt(struct rte_mbuf *pkt, uint8_t port) pkt->l3_len = sizeof(struct ip); pkt->l2_len = ETHER_HDR_LEN; + ip->ip_sum = 0; ethhdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4); } else { pkt->ol_flags |= PKT_TX_IPV6; @@ -477,11 +478,13 @@ outbound_sp(struct sp_ctx *sp, struct traffic_type *ip, sa_idx = ip->res[i] & PROTECT_MASK; if (ip->res[i] & DISCARD) rte_pktmbuf_free(m); + else if (ip->res[i] & BYPASS) + ip->pkts[j++] = m; else if (sa_idx < IPSEC_SA_MAX_ENTRIES) { ipsec->res[ipsec->num] = sa_idx; ipsec->pkts[ipsec->num++] = m; - } else /* BYPASS */ - ip->pkts[j++] = m; + } else /* invalid SA idx */ + rte_pktmbuf_free(m); } ip->num = j; } |