aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bgscan_learn.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2013-12-19 10:03:24 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-24 04:49:26 (GMT)
commit7dab1193803f90334e5cf8396a35f7ac8371041f (patch)
treea11aba13326cd1136772f62062b5b42e28902120 /wpa_supplicant/bgscan_learn.c
parent3727123269a1a380b51733049a8a9e1b63acf121 (diff)
downloadhostap-7dab1193803f90334e5cf8396a35f7ac8371041f.zip
hostap-7dab1193803f90334e5cf8396a35f7ac8371041f.tar.gz
hostap-7dab1193803f90334e5cf8396a35f7ac8371041f.tar.bz2
bgscan_learn: Avoid redundant frequencies
Some hw modes (e.g., 11b and 11g) contain the same frequencies, causing the supp_freqs array to be populated with redundant entries. Check for the existence of the freq before adding it. Signed-hostap: Eliad Peller <eliad@wizery.com>
Diffstat (limited to 'wpa_supplicant/bgscan_learn.c')
-rw-r--r--wpa_supplicant/bgscan_learn.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/wpa_supplicant/bgscan_learn.c b/wpa_supplicant/bgscan_learn.c
index 07d31e4..92ec55c 100644
--- a/wpa_supplicant/bgscan_learn.c
+++ b/wpa_supplicant/bgscan_learn.c
@@ -363,6 +363,9 @@ static int * bgscan_learn_get_supp_freqs(struct wpa_supplicant *wpa_s)
for (j = 0; j < modes[i].num_channels; j++) {
if (modes[i].channels[j].flag & HOSTAPD_CHAN_DISABLED)
continue;
+ /* some hw modes (e.g. 11b & 11g) contain same freqs */
+ if (in_array(freqs, modes[i].channels[j].freq))
+ continue;
n = os_realloc_array(freqs, count + 2, sizeof(int));
if (n == NULL)
continue;