]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use wpa_radio data for get_shared_radio_freqs()
authorJouni Malinen <j@w1.fi>
Sun, 24 Nov 2013 18:06:00 +0000 (20:06 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 24 Nov 2013 19:20:15 +0000 (21:20 +0200)
This replaces the now unnecessary iteration of get_radio_name() calls.

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

wpa_supplicant/wpa_supplicant.c

index f7f2fa284c13c50482aad054b74ec211e5cd37e4..f43ef1453f9252e1d398656026506d729342c1f5 100644 (file)
@@ -4137,7 +4137,6 @@ void dump_freq_array(struct wpa_supplicant *wpa_s, const char *title,
 int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
                           int *freq_array, unsigned int len)
 {
-       const char *rn, *rn2;
        struct wpa_supplicant *ifs;
        u8 bssid[ETH_ALEN];
        int freq;
@@ -4166,20 +4165,9 @@ int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
                return idx;
        }
 
-       rn = wpa_s->driver->get_radio_name(wpa_s->drv_priv);
-       if (rn == NULL || rn[0] == '\0') {
-               dump_freq_array(wpa_s, "get_radio_name failed",
-                               freq_array, idx);
-               return idx;
-       }
-
-       for (ifs = wpa_s->global->ifaces; ifs && idx < len;
-            ifs = ifs->next) {
-               if (wpa_s == ifs || !ifs->driver->get_radio_name)
-                       continue;
-
-               rn2 = ifs->driver->get_radio_name(ifs->drv_priv);
-               if (!rn2 || os_strcmp(rn, rn2) != 0)
+       dl_list_for_each(ifs, &wpa_s->radio->ifaces, struct wpa_supplicant,
+                        radio_list) {
+               if (wpa_s == ifs)
                        continue;
 
                if (ifs->current_ssid == NULL || ifs->assoc_freq == 0)