aboutgitcodebugslistschat
path: root/siphash.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-11-17 16:58:56 +1100
committerStefano Brivio <sbrivio@redhat.com>2022-11-25 01:35:34 +0100
commit685f97b8de9ebf2d959433b67aa2821364a6f7f6 (patch)
tree291bea140419f25108e3617ff3ab91aa6694caf3 /siphash.c
parentca69c3f1964846b27f8333cd06f7594289cbf53b (diff)
downloadpasst-685f97b8de9ebf2d959433b67aa2821364a6f7f6.tar
passt-685f97b8de9ebf2d959433b67aa2821364a6f7f6.tar.gz
passt-685f97b8de9ebf2d959433b67aa2821364a6f7f6.tar.bz2
passt-685f97b8de9ebf2d959433b67aa2821364a6f7f6.tar.lz
passt-685f97b8de9ebf2d959433b67aa2821364a6f7f6.tar.xz
passt-685f97b8de9ebf2d959433b67aa2821364a6f7f6.tar.zst
passt-685f97b8de9ebf2d959433b67aa2821364a6f7f6.zip
tcp: Hash IPv4 and IPv4-mapped-IPv6 addresses the same
In the tcp_conn structure, we represent the address with an inany_addr which could be an IPv4 or IPv6 address. However, we have different paths which will calculate different hashes for IPv4 and equivalent IPv4-mapped IPv6 addresses. This will cause problems for some future changes. Make the hash function work the same for these two cases, by taking an inany_addr directly. Since this represents IPv4 and IPv4-mapped IPv6 addresses the same way, it will trivially hash the same for both cases. Callers are changed to construct an inany_addr from whatever they have. Some of that will be elided in later changes. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'siphash.c')
-rw-r--r--siphash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/siphash.c b/siphash.c
index 37a6d73..516a508 100644
--- a/siphash.c
+++ b/siphash.c
@@ -104,6 +104,7 @@
*
* Return: the 64-bit hash output
*/
+/* cppcheck-suppress unusedFunction */
uint64_t siphash_8b(const uint8_t *in, const uint64_t *k)
{
PREAMBLE(8);