]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DFS: Remove the os_random() fallback
authorNick Lowe <nick.lowe@lugatech.com>
Tue, 9 Feb 2016 14:49:35 +0000 (14:49 +0000)
committerJouni Malinen <j@w1.fi>
Fri, 19 Feb 2016 16:44:40 +0000 (18:44 +0200)
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 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@lugatech.com>
src/ap/dfs.c

index 7273caad3cd34f91aa0a3e3acb05a88c45597601..bda23f0a21a08aa0b132a198dc21912a524d5619 100644 (file)
@@ -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);