diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2023-02-20 19:29:30 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2023-04-12 15:52:37 +0300 |
commit | adea8b08b8f95cc61d67650e4b1f63aac996f068 (patch) | |
tree | db1129705701f38a67ec230b83f034d042f6d49c /example/ipsec_crypto/odp_ipsec.c | |
parent | 5fd47520a2727b02d74e4b1e05b5e7f2048562bb (diff) |
example: ipsec_crypto: simplify crypto operation result checking
Check only odp_crypto_packet_result_t::ok to see if a crypto operation
succeeded. There is no need to check the status fields to second-guess
the validity of the ok field.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Diffstat (limited to 'example/ipsec_crypto/odp_ipsec.c')
-rw-r--r-- | example/ipsec_crypto/odp_ipsec.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/example/ipsec_crypto/odp_ipsec.c b/example/ipsec_crypto/odp_ipsec.c index c5dd7398e..dc56d671d 100644 --- a/example/ipsec_crypto/odp_ipsec.c +++ b/example/ipsec_crypto/odp_ipsec.c @@ -714,12 +714,9 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, odp_crypto_result(&result, pkt); /* Check crypto result */ - if (!result.ok) { - if (!is_crypto_op_status_ok(&result.cipher_status)) - return PKT_DROP; - if (!is_crypto_op_status_ok(&result.auth_status)) - return PKT_DROP; - } + if (!result.ok) + return PKT_DROP; + ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); /* @@ -1025,12 +1022,9 @@ pkt_disposition_e do_ipsec_out_finish(odp_packet_t pkt, odp_crypto_result(&result, pkt); /* Check crypto result */ - if (!result.ok) { - if (!is_crypto_op_status_ok(&result.cipher_status)) - return PKT_DROP; - if (!is_crypto_op_status_ok(&result.auth_status)) - return PKT_DROP; - } + if (!result.ok) + return PKT_DROP; + ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); /* Finalize the IPv4 header */ |