From 586c1800c447ff099d34889b23647c4733876d9b Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Wed, 27 Jun 2018 16:51:53 +0200 Subject: Nest: Neighbor cache cleanups Simplify neighbor cache code, fix several minor bugs, and improve handling of ONLINK flag. --- lib/hash.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/hash.h') diff --git a/lib/hash.h b/lib/hash.h index 97d8f69c..8809aedc 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -230,4 +230,11 @@ mem_hash(void *p, uint s) return mem_hash_value(&h); } +static inline uint +ptr_hash(void *ptr) +{ + uintptr_t p = (uintptr_t) ptr; + return p ^ (p << 8) ^ (p >> 16); +} + #endif -- cgit v1.2.3