aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-10-31 10:27:37 (GMT)
committerJouni Malinen <j@w1.fi>2010-10-31 10:27:37 (GMT)
commitb7412dabd94036b2d0f39e8cc8ab963c98d22164 (patch)
tree6a5622dba7b793a00a85050368f0f56ec2be6f37
parent79222cfa614594ac7fc32068c209268550440bfb (diff)
downloadhostap-b7412dabd94036b2d0f39e8cc8ab963c98d22164.zip
hostap-b7412dabd94036b2d0f39e8cc8ab963c98d22164.tar.gz
hostap-b7412dabd94036b2d0f39e8cc8ab963c98d22164.tar.bz2
P2P: Fix random channel selection to use os_get_random
This could have been using an uninitialized variable instead of purposefully random value in picking up the channel. There is not much of a difference for the use case here, but anyway, we may as well do what was initially planned here and.
-rw-r--r--wpa_supplicant/p2p_supplicant.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 1219f69..022ae38 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -2187,6 +2187,7 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s)
* For initial tests, pick the operation channel randomly.
* TODO: Use scan results (etc.) to select the best channel.
*/
+ os_get_random((u8 *) &r, sizeof(r));
p2p.op_channel = 1 + r % 11;
}
wpa_printf(MSG_DEBUG, "P2P: Own listen channel: %d "