]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Add BSS CURRENT control interface command
authorJoel Cunningham <joel.cunningham@me.com>
Mon, 19 Dec 2016 20:22:53 +0000 (14:22 -0600)
committerJouni Malinen <j@w1.fi>
Wed, 21 Dec 2016 10:42:20 +0000 (12:42 +0200)
This commit extends the BSS commands to include "BSS CURRENT" as a way
to get the current BSS without having to walk the BSS list matching
against BSSID+SSID returned from the STATUS command.

This returns the BSS stored in wpa_s->current_bss.

Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
wpa_supplicant/ctrl_iface.c

index 624e894cfe70f37e4d60c1b18a3da410c2b8a8a9..fc6fbdbc76d8dc5d60e8faa3f132e3a4b62813d1 100644 (file)
@@ -4650,6 +4650,8 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s,
                                bss = dl_list_entry(next, struct wpa_bss,
                                                    list_id);
                }
+       } else if (os_strncmp(cmd, "CURRENT", 7) == 0) {
+               bss = wpa_s->current_bss;
 #ifdef CONFIG_P2P
        } else if (os_strncmp(cmd, "p2p_dev_addr=", 13) == 0) {
                if (hwaddr_aton(cmd + 13, bssid) == 0)