summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_spd_fp_lookup.h
diff options
context:
space:
mode:
authorPiotr Bronowski <piotrx.bronowski@intel.com>2022-07-18 16:45:22 +0000
committerFan Zhang <roy.fan.zhang@intel.com>2022-08-02 10:15:43 +0000
commit818806062cd36a816fd778c6993d20d442d3d3ac (patch)
tree4fbc5915ae288d78f78963f1660a23b87aca43fe /src/vnet/ipsec/ipsec_spd_fp_lookup.h
parent69977d2398478c4ba45317e25b760587b6be5c9e (diff)
ipsec: fix coverity warnings found in fast path implementation
This patch fixes followig coverity issues: CID 274739 Out-of-bounds read CID 274746 Out-of-bounds access CID 274748 Out-of-bounds read Type: fix Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com> Change-Id: I9bb6741f100a9414a5a15278ffa49b31ccd7994f
Diffstat (limited to 'src/vnet/ipsec/ipsec_spd_fp_lookup.h')
-rw-r--r--src/vnet/ipsec/ipsec_spd_fp_lookup.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vnet/ipsec/ipsec_spd_fp_lookup.h b/src/vnet/ipsec/ipsec_spd_fp_lookup.h
index 912e18a3f8a..3aea86f70a0 100644
--- a/src/vnet/ipsec/ipsec_spd_fp_lookup.h
+++ b/src/vnet/ipsec/ipsec_spd_fp_lookup.h
@@ -140,8 +140,8 @@ ipsec_fp_ip6_out_policy_match_n (void *spd_fp, ipsec_fp_5tuple_t *tuples,
{
mte = im->fp_mask_types + *mti;
- pmatch = (u64 *) &match->ip6_laddr;
- pmask = (u64 *) &mte->mask.ip6_laddr;
+ pmatch = (u64 *) match->kv_40_8.key;
+ pmask = (u64 *) mte->mask.kv_40_8.key;
pkey = (u64 *) kv.key;
*pkey++ = *pmatch++ & *pmask++;
@@ -241,12 +241,12 @@ ipsec_fp_ip4_out_policy_match_n (void *spd_fp, ipsec_fp_5tuple_t *tuples,
{
mte = im->fp_mask_types + *mti;
- pmatch = (u64 *) &match->laddr;
- pmask = (u64 *) &mte->mask.laddr;
+ pmatch = (u64 *) match->kv_16_8.key;
+ pmask = (u64 *) mte->mask.kv_16_8.key;
pkey = (u64 *) kv.key;
*pkey++ = *pmatch++ & *pmask++;
- *pkey++ = *pmatch++ & *pmask++;
+ *pkey = *pmatch & *pmask;
int res = clib_bihash_search_inline_2_16_8 (
&pspd_fp->fp_ip4_lookup_hash, &kv, &result);