diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-10-25 02:00:01 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-10-25 02:00:01 +0200 |
commit | 29f7fc878888fc8a55bbd1978884bed781692928 (patch) | |
tree | 8ecefacb20f4219aaba2da08d1eb762126932195 /pimd | |
parent | pimd: Initialize nht_p variable (diff) | |
download | frr-29f7fc878888fc8a55bbd1978884bed781692928.tar.xz frr-29f7fc878888fc8a55bbd1978884bed781692928.zip |
pimd: Cast up to 64 bit to prevent overflow
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim_bsm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pimd/pim_bsm.c b/pimd/pim_bsm.c index ffaa858fa..9d42666b9 100644 --- a/pimd/pim_bsm.c +++ b/pimd/pim_bsm.c @@ -1033,7 +1033,8 @@ static uint32_t hash_calc_on_grp_rp(struct prefix group, struct in_addr rp, else grpaddr = grpaddr & mask; rp_add = ntohl(rp.s_addr); - temp = 1103515245 * ((1103515245 * grpaddr + 12345) ^ rp_add) + 12345; + temp = 1103515245 * ((1103515245 * (uint64_t)grpaddr + 12345) ^ rp_add) + + 12345; hash = temp & (0x7fffffff); return hash; } |