Patch for modification in random_init

Prameela Rani Garnepudi prameela.g at
Mon Mar 24 03:07:22 EDT 2014

Please review the below patch ralated to random_init. Attached the same.

From efac6a92322a965454c17d132e7e79705f389af0 Mon Sep 17 00:00:00 2001
From: Prameela Rani Garnepudi <prameela.g at>
Date: Mon, 24 Mar 2014 12:35:18 +0430
Subject: [PATCH] Random: Modification in random_init

In random_init return from the function immediately if random_entropy_file
is NULL. Because, the process of creating random_fd socket and thus,
eloop socket is unnecessary as the content read from /dev/random shall
be written to random_entropy_file which is NULL.

Signed-off-by: Prameela Rani Garnepudi <prameela.g at>
 src/crypto/random.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/crypto/random.c b/src/crypto/random.c
index 053740e..121200e 100644
--- a/src/crypto/random.c
+++ b/src/crypto/random.c
@@ -409,6 +409,8 @@ void random_init(const char *entropy_file)
                random_entropy_file = os_strdup(entropy_file);
                random_entropy_file = NULL;
+       if (!random_entropy_file)
+               return;

 #ifdef __linux__

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Random-Modification-in-random_init.patch
Type: application/octet-stream
Size: 1018 bytes
Desc: not available
URL: <>

More information about the HostAP mailing list