Avoid warnings from -fsanitize=integer in the hash functions.
authorGuus Sliepen <guus@tinc-vpn.org>
Fri, 13 Aug 2021 19:13:09 +0000 (21:13 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Fri, 13 Aug 2021 19:13:09 +0000 (21:13 +0200)
commit8c8dfd6686a3d4cc11c20a09c8dfbc8321b07cdb
treebd443ba1da7baccfe9e1884334618b17d401bf8e
parent9a018c2e371eb1cef9708ac71653f2f2868895fa
Avoid warnings from -fsanitize=integer in the hash functions.

Hash functions rely heavily on unsigned integer overflow behavior, but
the sanitizer complains about them. Instead of disabling the sanitizer
(which might prevent us from getting warnings from real errors), silence
it by explicitly upcasting values to 64-bit integers before applying
operations, then explicitly downcasting to 32-bit again. The compiler
will optimize this out.
src/subnet.c