From: Ilan Peer Date: Sun, 3 Nov 2013 13:29:13 +0000 (+0200) Subject: P2P: Fix bug in GO frequency selection X-Git-Tag: hostap_2_1~624 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dd3f86834457e0a6461980b45393902e5b65519;p=thirdparty%2Fhostap.git P2P: Fix bug in GO frequency selection When trying to choose a frequency that can be used for GO instantiation, properly check if there are free channels that can be used. Signed-hostap: Ilan Peer --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index f0accde57..25bf4e7e7 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -4605,7 +4605,7 @@ static int wpas_p2p_init_go_params(struct wpa_supplicant *wpa_s, } if (i == num) { - if (num == wpa_s->num_multichan_concurrent) { + if (wpas_p2p_num_unused_channels(wpa_s) <= 0) { wpa_printf(MSG_DEBUG, "P2P: Cannot force GO on any of the channels we are already using"); os_free(freqs); return -1; @@ -4620,7 +4620,7 @@ static int wpas_p2p_init_go_params(struct wpa_supplicant *wpa_s, } if (i == num) { - if (num == wpa_s->num_multichan_concurrent) { + if (wpas_p2p_num_unused_channels(wpa_s) <= 0) { wpa_printf(MSG_DEBUG, "P2P: Cannot force GO on freq (%u MHz) as all the channels are in use", freq); os_free(freqs); return -1;