summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/pnat/pnat.h
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2021-02-06 13:02:41 +0100
committerNeale Ranns <neale@graphiant.com>2021-02-09 09:56:56 +0000
commitc9c9143898aa1f5b5aa90ab03a4c94181dcf7ed6 (patch)
tree87ece208cd36415f92566cd2b3c4aebf4abeff94 /src/plugins/nat/pnat/pnat.h
parent070387d3f4b0b5a5742b95fca19404cb50fa9927 (diff)
nat: fix coverity errors
Including a general missing free in fromjson autogenerated code. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I9ab2b0193135e2fb3d62d51b3c114df56969e341 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/plugins/nat/pnat/pnat.h')
-rw-r--r--src/plugins/nat/pnat/pnat.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/nat/pnat/pnat.h b/src/plugins/nat/pnat/pnat.h
index c5869ce3ca6..af64fceb4d1 100644
--- a/src/plugins/nat/pnat/pnat.h
+++ b/src/plugins/nat/pnat/pnat.h
@@ -109,12 +109,11 @@ static inline void
pnat_calc_key(u32 sw_if_index, pnat_attachment_point_t attachment,
ip4_address_t src, ip4_address_t dst, u8 protocol, u16 sport,
u16 dport, pnat_mask_fast_t mask, clib_bihash_kv_16_8_t *kv) {
- kv->key[0] = kv->key[1] = 0;
kv->key[0] = (u64)src.as_u32 << 32 | dst.as_u32;
kv->key[0] &= mask.as_u64[0];
- kv->key[1] |=
+ kv->key[1] =
(u64)protocol << 56 | (u64)sw_if_index << 36 | (u64)attachment << 32;
- kv->key[1] |= sport << 16 | dport;
+ kv->key[1] |= (u32)sport << 16 | dport;
kv->key[1] &= mask.as_u64[1];
}