diff mbox

[2/2] hostapd: return ifname of current context

Message ID 1457257358-31275-2-git-send-email-eliad@wizery.com
State Accepted
Headers show

Commit Message

Eliad Peller March 6, 2016, 9:42 a.m. UTC
In case of multiple bss, return the current interface
name, instead of the first one.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 hostapd/main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/hostapd/main.c b/hostapd/main.c
index 06aa4b2..25dc20b 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -474,9 +474,8 @@  static void usage(void)
 static const char * hostapd_msg_ifname_cb(void *ctx)
 {
 	struct hostapd_data *hapd = ctx;
-	if (hapd && hapd->iconf && hapd->iconf->bss &&
-	    hapd->iconf->num_bss > 0 && hapd->iconf->bss[0])
-		return hapd->iconf->bss[0]->iface;
+	if (hapd && hapd->conf)
+		return hapd->conf->iface;
 	return NULL;
 }