summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-06-27 16:51:53 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-06-27 16:57:07 +0200
commit586c1800c447ff099d34889b23647c4733876d9b (patch)
treed2f3feec9aaabeffe2457d994f4c453e1d9e7782 /lib
parent45f28d85818f79790968725a945063228989bae7 (diff)
Nest: Neighbor cache cleanups
Simplify neighbor cache code, fix several minor bugs, and improve handling of ONLINK flag.
Diffstat (limited to 'lib')
-rw-r--r--lib/hash.h7
1 files changed, 7 insertions, 0 deletions
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