[PATCH 03/10] Remove the fallback dependency on os_random() from the code that gets a valid DFS channel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 Remove the fallback dependency on os_random() from the
 code that gets a valid DFS channel. This is exceptionally unlikely to ever be
 called as the call to os_get_random(...) is exceptionally unlikely to fail.
 The intention is to facilitate future removal of os_random() as it uses a low
 quality PRNG.

Signed-off-by: Nick Lowe <nick.lowe@xxxxxxxxxxxx>
---
 src/ap/dfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index 7273caa..bda23f0 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -450,7 +450,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
         return NULL;

     if (os_get_random((u8 *) &_rand, sizeof(_rand)) < 0)
-        _rand = os_random();
+        return NULL;
     chan_idx = _rand % num_available_chandefs;
     dfs_find_channel(iface, &chan, chan_idx, skip_radar);

-- 
2.5.0
From ceca2b59fb5d97b57b269b2a54eb8173b0bd7ef2 Mon Sep 17 00:00:00 2001
From: Nick Lowe <nick.lowe@xxxxxxxxxxxx>
Date: Tue, 9 Feb 2016 14:49:35 +0000
Subject: [PATCH 03/10] Remove the fallback dependency on os_random() from the
 code that gets a valid DFS channel. This is exceptionally unlikely to ever be
 called as the call to os_get_random(...) is exceptionally unlikely to fail.
 The intention is to facilitate future removal of os_random() as it uses a low
 quality PRNG.

Signed-off-by: Nick Lowe <nick.lowe@xxxxxxxxxxxx>
---
 src/ap/dfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index 7273caa..bda23f0 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -450,7 +450,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
 		return NULL;
 
 	if (os_get_random((u8 *) &_rand, sizeof(_rand)) < 0)
-		_rand = os_random();
+		return NULL;
 	chan_idx = _rand % num_available_chandefs;
 	dfs_find_channel(iface, &chan, chan_idx, skip_radar);
 
-- 
2.5.0

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap

[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux