summaryrefslogtreecommitdiffstats
path: root/src/plugins/cnat
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2021-02-26 14:32:55 +0100
committerFlorin Coras <florin.coras@gmail.com>2021-02-26 19:55:08 +0000
commit4f0ac7e833fffe8fec659037efe0928d1bba0677 (patch)
tree9b886e25aebf0d6bbe91c5eb246451c56075d962 /src/plugins/cnat
parent90ffe06c6b15b34b19ec4049fe739ecb92546add (diff)
cnat: coverity fix
Type: fix Change-Id: I9d562abc8d8f59cfe73ddd4c03a25085f6ad1f84 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/cnat')
-rw-r--r--src/plugins/cnat/cnat_translation.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/cnat/cnat_translation.c b/src/plugins/cnat/cnat_translation.c
index 8b7cf2451b7..bd456c82fef 100644
--- a/src/plugins/cnat/cnat_translation.c
+++ b/src/plugins/cnat/cnat_translation.c
@@ -248,7 +248,8 @@ cnat_translation_init_maglev (cnat_translation_t *ct)
{
u32 a, b, c;
a = ip_addr_v4 (&trk->ct_ep[VLIB_TX].ce_ip).data_u32;
- b = trk->ct_ep[VLIB_TX].ce_port << 16 | trk->ct_ep[VLIB_RX].ce_port;
+ b = (u64) trk->ct_ep[VLIB_TX].ce_port << 16 |
+ (u64) trk->ct_ep[VLIB_RX].ce_port;
c = ip_addr_v4 (&trk->ct_ep[VLIB_RX].ce_ip).data_u32;
hash_v3_mix32 (a, b, c);
hash_v3_finalize32 (a, b, c);
@@ -260,7 +261,8 @@ cnat_translation_init_maglev (cnat_translation_t *ct)
u64 a, b, c;
a = ip_addr_v6 (&trk->ct_ep[VLIB_TX].ce_ip).as_u64[0] ^
ip_addr_v6 (&trk->ct_ep[VLIB_TX].ce_ip).as_u64[1];
- b = trk->ct_ep[VLIB_TX].ce_port << 16 | trk->ct_ep[VLIB_RX].ce_port;
+ b = (u64) trk->ct_ep[VLIB_TX].ce_port << 16 |
+ (u64) trk->ct_ep[VLIB_RX].ce_port;
c = ip_addr_v6 (&trk->ct_ep[VLIB_RX].ce_ip).as_u64[0] ^
ip_addr_v6 (&trk->ct_ep[VLIB_RX].ce_ip).as_u64[1];
hash_mix64 (a, b, c);