]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use wpa_drv_shared_freq() if get_radio_name() is not supported
authorJouni Malinen <j@w1.fi>
Sun, 21 Jul 2013 17:46:54 +0000 (20:46 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 21 Jul 2013 17:48:09 +0000 (20:48 +0300)
Some driver interfaces may not support the get_radio_name() design and
get_shared_radio_freqs() needs to be aware of such possibility when
determining shared radio frequencies.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/wpa_supplicant.c

index 62417ac7bd9637d86759126d02eb8e1f07070397..bcb5ae949fa516512633da33b8890bf7e6df70ff 100644 (file)
@@ -3969,8 +3969,13 @@ int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
        }
 
        /* If get_radio_name is not supported, use only the local freq */
-       if (!wpa_s->driver->get_radio_name)
+       if (!wpa_s->driver->get_radio_name) {
+               freq = wpa_drv_shared_freq(wpa_s);
+               if (freq > 0 && idx < len &&
+                   (idx == 0 || freq_array[0] != freq))
+                       freq_array[idx++] = freq;
                return idx;
+       }
 
        rn = wpa_s->driver->get_radio_name(wpa_s->drv_priv);
        if (rn == NULL || rn[0] == '\0')