From: dlg Date: Wed, 17 May 2023 10:22:17 +0000 (+0000) Subject: fix stoeplitz_hash_h32. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2c85293ca1a6616298520f9f157b476222578b11;p=openbsd fix stoeplitz_hash_h32. discussed with and ok tb@ --- diff --git a/sys/net/toeplitz.h b/sys/net/toeplitz.h index 03060828408..52933eb30c8 100644 --- a/sys/net/toeplitz.h +++ b/sys/net/toeplitz.h @@ -1,4 +1,4 @@ -/* $OpenBSD: toeplitz.h,v 1.10 2022/12/27 20:13:03 patrick Exp $ */ +/* $OpenBSD: toeplitz.h,v 1.11 2023/05/17 10:22:17 dlg Exp $ */ /* * Copyright (c) 2019 David Gwynne @@ -92,9 +92,9 @@ stoeplitz_hash_h16(const struct stoeplitz_cache *scache, uint16_t h16) } static __unused inline uint16_t -stoeplitz_hash_h32(const struct stoeplitz_cache *scache, uint64_t h32) +stoeplitz_hash_h32(const struct stoeplitz_cache *scache, uint32_t h32) { - return (stoeplitz_hash_h16(scache, h32 & (h32 >> 16))); + return (stoeplitz_hash_h16(scache, h32 ^ (h32 >> 16))); } static __unused inline uint16_t