summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-11-04 16:49:06 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-11-04 16:49:06 +0100
commit7e3ee88aab795d44b53f2c6d967f2fb5140554f6 (patch)
treea11f6df244e5d089257fde19d29b9387b4e2d647 /src
parent1180648e666953a13818c883f9c866e51ad125ad (diff)
compat: some grsec have get_random_long; others do not
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r--src/compat.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compat.h b/src/compat.h
index 6d9c0e2..b2cc9c9 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -18,9 +18,10 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
#include <linux/security.h>
-#ifndef GRSECURITY_VERSION
-#define get_random_long() (((u64)get_random_int() << 32) | get_random_int())
+#ifdef GRSECURITY_VERSION
+#include <linux/random.h>
#endif
+#define get_random_long() (((u64)get_random_int() << 32) | get_random_int())
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)