summaryrefslogtreecommitdiffstats
path: root/recipes-support
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-support')
-rw-r--r--recipes-support/rng-tools/rng-tools/When-adding-entropy-allocate-the-struct-dynamically.patch50
-rw-r--r--recipes-support/rng-tools/rng-tools_5.bbappend3
2 files changed, 0 insertions, 53 deletions
diff --git a/recipes-support/rng-tools/rng-tools/When-adding-entropy-allocate-the-struct-dynamically.patch b/recipes-support/rng-tools/rng-tools/When-adding-entropy-allocate-the-struct-dynamically.patch
deleted file mode 100644
index 9bed536..0000000
--- a/recipes-support/rng-tools/rng-tools/When-adding-entropy-allocate-the-struct-dynamically.patch
+++ /dev/null
@@ -1,50 +0,0 @@
1From 27f234a1bb97f7196466a3535a072fda1b66ea1e Mon Sep 17 00:00:00 2001
2From: Christopher Larson <chris_larson@mentor.com>
3Date: Mon, 15 Feb 2016 16:46:46 -0700
4Subject: [PATCH] When adding entropy, allocate the struct dynamically
5
6Clang/LLVM does not support struct fields without a constant size. Also, we
7can use the existing struct defined by linux/random.h.
8
9Upstream-Status: Pending
10Signed-off-by: Christopher Larson <chris_larson@mentor.com>
11---
12 rngd_linux.c | 16 +++++++---------
13 1 file changed, 7 insertions(+), 9 deletions(-)
14
15diff --git a/rngd_linux.c b/rngd_linux.c
16index c4f45de..8f6cca7 100644
17--- a/rngd_linux.c
18+++ b/rngd_linux.c
19@@ -120,21 +120,19 @@ void init_kernel_rng(const char* randomdev)
20
21 void random_add_entropy(void *buf, size_t size)
22 {
23- struct {
24- int ent_count;
25- int size;
26- unsigned char data[size];
27- } entropy;
28+ struct rand_pool_info *entropy = malloc(sizeof(struct rand_pool_info) + size);
29
30- entropy.ent_count = size * 8;
31- entropy.size = size;
32- memcpy(entropy.data, buf, size);
33+ entropy->entropy_count = size * 8;
34+ entropy->buf_size = size;
35+ memcpy(entropy->buf, buf, size);
36
37- if (ioctl(random_fd, RNDADDENTROPY, &entropy) != 0) {
38+ if (ioctl(random_fd, RNDADDENTROPY, entropy) != 0) {
39 message(LOG_DAEMON|LOG_ERR, "RNDADDENTROPY failed: %s\n",
40 strerror(errno));
41+ free(entropy);
42 exit(1);
43 }
44+ free(entropy);
45 }
46
47 void random_sleep(void)
48--
492.2.1
50
diff --git a/recipes-support/rng-tools/rng-tools_5.bbappend b/recipes-support/rng-tools/rng-tools_5.bbappend
deleted file mode 100644
index 6d5aec4..0000000
--- a/recipes-support/rng-tools/rng-tools_5.bbappend
+++ /dev/null
@@ -1,3 +0,0 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
3SRC_URI += "file://When-adding-entropy-allocate-the-struct-dynamically.patch"