X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsubnet.c;h=17dd39e83b334d1f7774f54dafdb26dd3b7d4f8f;hb=1022812ed4b5c70162f2f0a9d9a96c716c936408;hp=602177ffef3e146bccb71a49c42eba50112bb572;hpb=ac2a1722b71e98010324ed46235e96bfa6e672f5;p=tinc diff --git a/src/subnet.c b/src/subnet.c index 602177ff..17dd39e8 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -83,7 +83,7 @@ static uint32_t hash_function_ipv6_t(const ipv6_t *p) { uint32_t hash = hash_seed; for(int i = 0; i < 4; i++) { - hash += fullwidth[i]; + hash = wrapping_add32(hash, fullwidth[i]); hash = wrapping_mul32(hash, 0x9e370001U); } @@ -95,7 +95,7 @@ static uint32_t hash_function_mac_t(const mac_t *p) { uint32_t hash = hash_seed; for(int i = 0; i < 3; i++) { - hash += halfwidth[i]; + hash = wrapping_add32(hash, halfwidth[i]); hash = wrapping_mul32(hash, 0x9e370001U); }