summaryrefslogtreecommitdiffhomepage
path: root/src/wireguard.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-08-21 20:13:17 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-08-22 01:47:28 +0200
commit023946ff3bcf0817f23467a1d900e0f7bcecd1a5 (patch)
treefc2942552ac760ae6db2e3507e5ecc7bca3f8585 /src/wireguard.h
parentc5c984b37db39ecbb5e7547f040b6d2b9e84dee1 (diff)
hashtables: use rdrand() instead of counter
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/wireguard.h')
-rw-r--r--src/wireguard.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wireguard.h b/src/wireguard.h
index 5c83ab6..2985323 100644
--- a/src/wireguard.h
+++ b/src/wireguard.h
@@ -36,6 +36,10 @@
#define net_dbg_ratelimited(fmt, ...) do { if (0) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0)
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
+#define get_random_long() (((u64)get_random_int() << 32) | get_random_int())
+#endif
+
struct wireguard_device {
struct sock __rcu *sock4, *sock6;
u16 incoming_port;