diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2022-09-23 10:12:10 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2022-09-23 15:59:00 +0300 |
commit | c81dbe08b422a92e517bbd40645ad61931ccdd9e (patch) | |
tree | 6d272e5037fad9237957a61785c11b4cde3a4f4d | |
parent | a6b8554814ca4c3f859433788b678443a0e698fd (diff) |
linux-dpdk: crypto: fix pool checking before metadata copying
The packet metadata copying check in a crypto operation assumes that the
pool of the output packet is the pool configured in the session, but that
is not necessarily the case when an ODP application passes an explicit
output packet to a crypto operation. In that case the pool of the session
could even be ODP_POOL_INVALID.
Fix the bug by reading destination pool from the output packet.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
-rw-r--r-- | platform/linux-dpdk/odp_crypto.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c index 71099e94f..026132579 100644 --- a/platform/linux-dpdk/odp_crypto.c +++ b/platform/linux-dpdk/odp_crypto.c @@ -1846,7 +1846,7 @@ int odp_crypto_int(odp_packet_t pkt_in, int ret; int md_copy; - md_copy = _odp_packet_copy_md_possible(session->p.output_pool, + md_copy = _odp_packet_copy_md_possible(odp_packet_pool(out_pkt), odp_packet_pool(pkt_in)); if (odp_unlikely(md_copy < 0)) { ODP_ERR("Unable to copy packet metadata\n"); |