From 685f97b8de9ebf2d959433b67aa2821364a6f7f6 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 17 Nov 2022 16:58:56 +1100 Subject: 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 Signed-off-by: Stefano Brivio --- siphash.c | 1 + 1 file changed, 1 insertion(+) (limited to 'siphash.c') 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); -- cgit v1.2.3