diff mbox

wpa_cli command to get current BSS

Message ID 3BE32B09-96B9-4C1D-90F7-53CB0B3CDEDC@me.com
State Accepted
Headers show

Commit Message

Joel Cunningham Dec. 19, 2016, 9:13 p.m. UTC
From b0ead703d1bd27934759689d95f54e417948cadf Mon Sep 17 00:00:00 2001
From: Joel Cunningham <joel.cunningham@me.com>
Date: Mon, 19 Dec 2016 14:22:53 -0600
Subject: [PATCH] WPA supplicant: add BSS CURRENT command

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 | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jouni Malinen Dec. 21, 2016, 11:19 a.m. UTC | #1
On Mon, Dec 19, 2016 at 03:13:00PM -0600, Joel Cunningham wrote:
> 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

Thanks, applied.
diff mbox

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 4439efb..bdd1f58 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -4561,6 +4561,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)